在mailto正文中添加linebreak [英] adding linebreak in mailto body

查看:76
本文介绍了在mailto正文中添加linebreak的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,


我正在使用表单中的值设置电子邮件的正文

firstname = bob

lastname = dole


ebody =''名字:''+名字+''\ r \\ n''''''姓氏:' '+ lastname


window.location.href =''mailto:my ***** @ mycompany.com?subject=test

email& body =''+ ebody;


如果我做了警报(ebody);我在firstname&

lastname之间得到了换行符,但是当它打开outlook时,整个ebody字符串

在电子邮件正文中没有换行符。


我也试过了。有什么东西可以成为一条线

休息吗?

解决方案

在文章< f7 ***** *********************@posting.google.com>,
st ************** @ hotmail.com (nAmYzArC)写道:

大家好,

我正在使用表格中的值来设置电子邮件的正文


http://www.allmyfaqs.com/faq.pl?Email_form_data

< a rel =nofollowhref =http://www.isolani.co.uk/articles/mailto.htmltarget =_ blank> http://www.isolani.co.uk/articles/mailto.html


如果您想要可靠地发送电子邮件,请从服务器发送。

-

Randy

发布的所有代码都取决于查看浏览器

支持所调用的方法,并且启用了Javascript。


>如果您想要可靠地发送电子邮件,请从服务器发送。


这不是我原始问题中规定的要求。我很好

意识到发送电子邮件服务器端的优势。但是,无论如何,感谢

输入。


在文章< f7 *************** ***********@posting.google.com>,
st ************** @ hotmail.com 说...

如果你想要可靠的话发送电子邮件,从服务器发送。



这不是我原始问题中的要求。我很清楚发送邮件服务器端的优点。但是非常感谢
输入。



使用mailto生成一条消息是假的,至少可以说只有

的业余爱好者这样做。


我的建议是......


1.让用户创建身体,不要担心添加任何CR / LF

2.使用ASPMail等服务器组件为您完成。


Hi everyone,

I''m setting the body of an email using values from a form

firstname = bob
lastname = dole

ebody = ''First Name: '' + firstname + ''\r\n'' + ''Last Name: '' + lastname

window.location.href = ''mailto:my*****@mycompany.com?subject=test
email&body='' + ebody;

If I do an "alert(ebody);" I get the linebreak between firstname &
lastname, however when it opens up outlook, the entire ebody string
appears without a linebreak in the email body.

I''ve tried just \n also. is there something that can give be a line
break?

解决方案

In article <f7**************************@posting.google.com >,
st**************@hotmail.com (nAmYzArC) writes:

Hi everyone,

I''m setting the body of an email using values from a form



http://www.allmyfaqs.com/faq.pl?Email_form_data

http://www.isolani.co.uk/articles/mailto.html

If you want to reliably send email, send it from the server.
--
Randy
All code posted is dependent upon the viewing browser
supporting the methods called, and Javascript being enabled.


> If you want to reliably send email, send it from the server.

This is not a requirement stated in my original question. I am well
aware of the advantages of sending email server-side. But thanks for
the input anyway.


In article <f7**************************@posting.google.com >,
st**************@hotmail.com says...

If you want to reliably send email, send it from the server.



This is not a requirement stated in my original question. I am well
aware of the advantages of sending email server-side. But thanks for
the input anyway.


Well using mailto to GENERATE a message is bogus to say the least and only
amateurs do it.

My suggestion would be to either...

1. Let the user CREATE the body and don''t worry about adding any CR/LF
2. Use an some server component such as ASPMail to do it for you.


这篇关于在mailto正文中添加linebreak的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆