Reputation: 254
I have a simple div
with onclick
attribute. The attribute contains a mailto
achor tag so if the visitor click on the div his/her mail client pops up with a new mail window.
My problem is that I have a sample tag in the mail body with line breaks. In OS X Mail.app, Windows' Outlook, Gmail and even in my Windows Phone 7.5 default mail client it works perfectly but on my iPhone or iPad there are no line-breaks.
For line-breaks I use the following code: \u2029
.
I copy the whole code so you can understand my problem:
<?php
$linebreak = '\u2029';
$signup_email = '[email protected]';
$signup_subject = 'Signup';
$signup_body = 'Dear Company,'. $linebreak . $linebreak .'I would like to signup as the following'. $linebreak .'My name: '. $linebreak .'My e-mail: '. $linebreak . $linebreak . $linebreak .'Best regards, '. $linebreak;
?>
<div id="signup" class="left" onclick="location.href='mailto:<?=$signup_email;?>?subject=<?=$signup_subject;?>&body=<?=$signup_body;?>';">Signup</div>
The sample text is just a sample text, I don't want to make a signup form like this (it would be so lame (: )
Upvotes: 2
Views: 3132
Reputation: 254
OK, I just figured it out.
In this post the author says you should use %0D%0A squence to break lines. And it works! I tried in Gmail, OS X default Mail.app, MS Outlook and Thunderbird on Windows XP/7, Windows Phone 7.5, iOS 5.1 and iOS 4.2.1.
Upvotes: 1