If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > ASP > Newline characters in mail content

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 01-09-04, 08:49
yisraelharris yisraelharris is offline
Registered User
 
Join Date: Apr 2003
Posts: 21
Newline characters in mail content

I wish to send an email, and I want the ability to place explicit newline characters in the content (bodyText) of the mail.

I have tried both br and backslash-n. In both cases, instead of being interpreted as a newline character, they appear literally.

Thank you in advance for solutions.

For futher clarification, here is my code. All works fine except for the newline problem:

set Mailer = Server.CreateObject("SMTPsvg.Mailer")
Mailer.RemoteHost = "kabbalaonline.org"
Mailer.FromName = "tom"
Mailer.FromAddress = "tom@mail.com"
Mailer.AddRecipient "joe", "joe@mail.com"
Mailer.Subject = "hello, joe"
Mailer.BodyText = "this is line 1<br>this is line2"
if Mailer.SendMail then
Response.Write("ok")
else
Response.Write("Mailer.Response")
end if
set Mailer = nothing
Reply With Quote
  #2 (permalink)  
Old 01-09-04, 23:15
MrWizard MrWizard is offline
Registered User
 
Join Date: Mar 2003
Location: Atlanta, GA
Posts: 191
Try this...

I believe the mailer component you're using defaults to plain text content if not otherwise specified.

For text emails, you can try:

"this is line 1" & VbCrLf & "this is line2"

For html email, a <br> should work... you just need to specify the email to be html content...

Mailer.ContentType = "text/html" OR Mailer.ContentType = "text/plain"

Cheers...

Tim
__________________
Tim
Reply With Quote
  #3 (permalink)  
Old 01-10-04, 04:49
yisraelharris yisraelharris is offline
Registered User
 
Join Date: Apr 2003
Posts: 21
Thank you very much.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On