Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Inserting carriage returns in an email

Status
Not open for further replies.

jakeyg

Programmer
Mar 2, 2005
517
GB
got the following function to send emails which works peachy
only problem is I want a carriage return at the end of the line

I've tried <BR>, %0D%0A and vbCrLf in various guises and places and I always end up with <BR>, %0D%0A or vbCrLf in instead of a carriage return

It's called in an ASP page, which passes in the recipient

function SendEmail(sTo)
Set objNewMail = Server.CreateObject("CDONTS.NewMail")
objNewMail.BodyFormat = 0
objNewMail.MailFormat = 0

strBody = " Thank you for registering %0D%0A "
strBody = strBody & "The website address is "

objNewMail.Body= strbody
objNewMail.send "me@home.co.uk", sTo , "the subject"

Set objNewMail = Nothing
end function

any ideas on which code/method/punctation I need to get a carriage return in

thanks
 
strBody = " Thank you for registering " & vbNewLine

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
No
it still sends the email though, just not with the carriage return
hmm
 
jakeyg,

Try this, as you're using html format.
[tt]
strBody = " Thank you for registering[blue]<br>[/blue]"
strBody = strBody & "The website address is "
[/tt]
regards - tsuji
 
Tried putting them in again for the crack and that's it working.
That was what I had in in the first place that didn't work, cause I had the address in <A> tags too and that didn't work either and that works now too :-S

thanks and sorry for the dullard question
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top