Welcome Guest, Not a member yet? Register   Sign In
URL helper - adding subject data to mailto()
#1

[eluser]aBoy[/eluser]
Hi.

Is there a way to add extra data to a safe_mailto() call?

Code:
$emailAtts = array('subject' => $this->lang->line('contacts_subject'),
        'message' => $this->lang->line('contacts_message'));

...

echo '<p><span class="formLabel">'.$this->lang->line('contacts_email').'</span>'.safe_mailto($d->contactEmail, $d->contactEmail, $emailAtts).'</p>';

The above code won't work for me. Sad
#2

[eluser]Clooner[/eluser]
[quote author="aBoy" date="1213598978"]Hi.
Code:
$emailAtts = array('subject' => $this->lang->line('contacts_subject'),
        'message' => $this->lang->line('contacts_message'));

...

echo '<p><span class="formLabel">'.$this->lang->line('contacts_email').'</span>'.safe_mailto($d->contactEmail, $d->contactEmail, $emailAtts).'</p>';
[/quote]
I wouldn't use the second $d->contactEmail cause that is a title. So I would at least put something else there.

Nonetheless I think this should work. What is the html result?
#3

[eluser]xwero[/eluser]
In my opinion once you start adding more data than only the email you better of creating a contact form to have more control. If you add the subject to the mailto link nothing prevents the sender to change the subject in the email client. If the extra data is a placeholder for the real content like : 'here your subject' and 'here your message'. The sender has to delete it which isn't userfriendly.

A bonus of a contact form is that the recipients email address isn't on the site so it can't be screenscraped.
#4

[eluser]Clooner[/eluser]
But that is why there is a safemailto function right? and next to that, sometimes the customer just wants the cheapest option...
#5

[eluser]xwero[/eluser]
The safe_mailto function has a bit of a false promise because it's not that safe. Black hat screenscapers are smart enough to identify ordinal numbers and translate them into the correct character.

I think a contact form is a stable page so you should have the code already which shouldn't affect the cost of the website as it is a drag and drop operation. I think the days of the pay-your-website-per-page are over. I rather go for a happy customer form the start then a customer who has to complain about the filling of his inbox with spam and letting him pay for the adding of a contact form.
Lost of customers want their email address on the pages so why should you bother with a safemailto function if it can be found in plain text somewhere else on the page.
#6

[eluser]aBoy[/eluser]
I agree the form is a better option. In this instance however, the mailto link suits the style of the page better. I had a feeling the javascript was vulnerable ... I'm still considering my options ... to answer Clooner's question it appears as though the script is doing its job;

Code:
message="';l[33]='"';l[34]='|121';l[35]='|114';l[36]='|105';l[37]='|117';l[38]='|113';l[39]='|110';l[40]='|69';l[41]='|32';l[42]='|101';l[43]='|116';l[44]='|105';l[45]='|115';l[46]='|98';l[47]='|101';l[48]='|87';l[49]='|32';l[50]='|103';l[51]='|65';l[52]='|32';l[53]='|101';l[54]='|116';l[55]='|97';l[56]='|116';l[57]='|115';l[58]='|110';l[59]='|117';l[60]='|83';l[61]='
subject="';l[62]='"';l[63]='|109';l[64]='|111';l[65]='|99';l[66]='|46';l[67]='|121';l[68]='|114';l[69]='|116';l[70]='|110';l[71]='|117';l[72]='|111';l[73]='|99';l[74]='|64';l[75]='|104';l[76]='|116';l[77]='|101';l[78]='|98';l[79]='|45';l[80]='|111';l[81]='|106';l[82]=':';l[83]='o';l[84]='t';l[85]='l';l[86]='i';l[87]='a';l[88]='m';l[89]='"';l[90]='=';l[91]='f';l[92]='e';l[93]='r';l[94]='h';l[95]=' ';l[96]='a';l[97]='<'

.. but the link is only adding the "To:" portion in my email client(outlook express). I'm using Firefox and IE7 to test.
#7

[eluser]skattabrain[/eluser]
just trying to spackle an unanswered thread, this works for me on 1.6.3 ...

Code:
safe_mailto('[email protected]&subject=Testing', 'email me');




Theme © iAndrew 2016 - Forum software by © MyBB