0

I'm using a mailto link to send e-mail with a php string variable inside it as follows:

'Would you like to E-mail stakeholders? <a class="emailLink" href="mailto:stakeholders?subject=Alert '.$ticket.'&body=Experience:  %0D%0A'.$exp.'">Review and Send!</a><br><br>';

I discovered that in the e-mail client it prints it out like:

Experience:  
Th Experience should contain:\r\n\r\nImpact\r\nHow to replicate\r\nComprehensive notes

So I tried:

$charactersToRemove = array("\r\n","\n","\r");
$replaceWith = "%0D%0A";
$exp = str_replace($charactersToRemove,$replaceWith,$exp);

Which doesn't seem to make a difference...Can someone tell me why? Thanks.

4

1 回答 1

0

您可以发布更多代码以显示如何$exp分配它的价值吗?

我已经编辑了我的答案,直到我能提供更好的帮助。

编辑:您可以认真尝试使用"\r\n"with\"来转义",以防万一 PHP%0D$0A在您的 HTML 输出中以某种方式本地化?您的页面来源是什么样的?

于 2013-02-24T01:13:17.563 回答