| 11:22 pm on Feb 4, 2012 (gmt 0)|
You should probably be url encoding (percent triplet) the parameter values, in which case the newline would be %0A (ascii 10) and carriage return %0D (ascii 13). I guess this will be down to the email client whether it is handled as expected.
| 12:17 am on Feb 5, 2012 (gmt 0)|
var mailto_link = 'mailto:'+email+'?subject='+subject+'&body=%0ALine1: '+body1+' %0ALine2: '+body2+' %0ALine3: '+body3;
Or, instead of %0A I could use %0D instead?
| 1:04 am on Feb 5, 2012 (gmt 0)|
Yes. That works for me on Windows with Thunderbird. Just the newline (LineFeed / %0A) character should be sufficient I would have thought.
| 5:39 pm on Feb 6, 2012 (gmt 0)|
Strange. I tried that; but now it doesn't even send an email. Although I think I have bigger problems because I need to be able to change the subject each time.
| 6:21 pm on Feb 6, 2012 (gmt 0)|
|...it doesn't even send an email. |
Doesn't send? Or doesn't open the email client?
|...+subject+'&body=%0ALine1: '... |
Just to add, if this is used in an HTML document then the ampersand should be entity encoded as &
| 12:29 am on Feb 7, 2012 (gmt 0)|
It doesn't send the message (no message received) and it doesn't even open the email client to send the message. What about with a "?", do I need to make that different like the &?
| 7:39 am on Feb 7, 2012 (gmt 0)|
You don't need to encode the "?".
Can you post the exact code you are using?
| 11:09 pm on Feb 7, 2012 (gmt 0)|
var daReferrer = document.referrer;
var email = "email@example.com, firstname.lastname@example.org";
var errorMsg = "error message";
var subject = document.subject.value;
var name = "John Doe";
var complaint = "The product was faulty";
var ttime = "12:00";
var tdate = "Jan 1, 2012";
var mailto_link = 'mailto:'+email+'?subject='+subject+ttime+tdate+'&body=Complaint: '+complaint;
win = window.open(mailto_link,'emailWindow');
if (win && win.open &&!win.closed) win.close();
<div style="border:2px solid black;padding:10px;">
Please <a href="#" onclick="emailForm();">Submit Complaint</a>
The "valid_email" is the first part of my email address so I changed that.