Hi, Does anybody know how to create a new line in an email body ? code: Dim objMailMessage As MailMessage objMailMessage = New MailMessage() objMailMessage.From = "iedean@ie.technion.ac.il" objMailMessage.To = emailto objMailMessage.Subject = message_subject
objMailMessage.Body = " text new line text " SmtpMail.SmtpServer = "localhost" SmtpMail.Send(objMailMessage) Thanks in advance ,Eran
Append newline characters (Environment.NewLine or vbCrLf) to the body text where you want the new line to appear (you can build the body using string concatenation).
I tried this as: objMail.Body = fname & Environment.NewLine & lname & Environment.NewLine & address & Environment.NewLine & state & Environment.NewLine & zipcode and using System.Environment.Newline, but I keep getting this error: Object required: 'System'
or Object required: 'Environment' What do I have to declare earlier to make this work?
I'm using an ASP file written by someone else. This is a Web page, so I don't think it's really "compiled" from what little I know of ASP pages. If I'm wrong, where would I check? Thanks for your help. -Frances
I'm editing some other developer's code (someone from another company), and as you can probably tell, I don't know much about ASP or VB. Does this answer your question? Set objMail = Server.CreateObject("CDONTS.NewMail")
eranyael
Member
220 Points
44 Posts
creating new line in an email
Oct 12, 2003 12:01 PM|LINK
joteke
All-Star
46284 Points
6896 Posts
ASPInsiders
MVP
Re: creating new line in an email
Oct 12, 2003 12:12 PM|LINK
Teemu Keiski
Finland, EU
Colt
All-Star
15569 Points
1986 Posts
ASPInsiders
MVP
Re: creating new line in an email
Oct 12, 2003 02:22 PM|LINK
" as a line break. Regards,
fpoon
Member
25 Points
5 Posts
Re: creating new line in an email
Oct 22, 2003 12:42 AM|LINK
joteke
All-Star
46284 Points
6896 Posts
ASPInsiders
MVP
Re: creating new line in an email
Oct 22, 2003 02:45 PM|LINK
Teemu Keiski
Finland, EU
fpoon
Member
25 Points
5 Posts
Re: creating new line in an email
Oct 22, 2003 04:13 PM|LINK
longhorn2005
All-Star
22676 Points
1368 Posts
Re: creating new line in an email
Oct 22, 2003 05:18 PM|LINK
Proper Preparation Prevents Poor Performance
My Blog
fpoon
Member
25 Points
5 Posts
Re: creating new line in an email
Oct 22, 2003 08:09 PM|LINK
russnem
Contributor
7001 Points
1389 Posts
ASPInsiders
MVP
Re: creating new line in an email
Oct 22, 2003 08:10 PM|LINK
fpoon
Member
25 Points
5 Posts
Re: creating new line in an email
Oct 22, 2003 09:18 PM|LINK