Hello!
Could somebody help me with my code? The problem is - I can't make vbcrlf work for the plain text e-mail. If I am using vbcrlf people getting unformatted text (no new lines). Same as if I preview it in browser using Response.Write( strBodyText) --- see below.
If I use "<br>" instead of vbcrlf than users are getting text displaying <BR> "Dear Name<br>text... ..<br>Thank you, etc"
Please advise how to send plain text e-mail with carriage return correctly.
P.S. I tryed Chr(13), Chr (10), vbnewline - nothing helps.... :(
Thanks
[PHP]<%
Dim objMyMessage, objMyConfigurat ion
Set objMyMessage = Server.CreateOb ject("CDO.Messa ge")
Set objMyConfigurat ion = Server.CreateOb ject ("CDO.Configura tion")
objMyConfigurat ion.Fields("htt p://schemas.microso ft.com/cdo/configuration/sendusing") = 2
objMyConfigurat ion.Fields("htt p://schemas.microso ft.com/cdo/configuration/smtpserver") = "mail.server.co m"
objMyConfigurat ion.Fields("htt p://schemas.microso ft.com/cdo/configuration/smtpserverport" ) = 25
objMyConfigurat ion.Fields("htt p://schemas.microso ft.com/cdo/configuration/smtpusessl") = False
objMyConfigurat ion.Fields("htt p://schemas.microso ft.com/cdo/configuration/smtpconnectiont imeout") = 60
objMyConfigurat ion.Fields("htt p://schemas.microso ft.com/cdo/configuration/smtpauthenticat e") = 1 'basic (clear-text) authentication
objMyConfigurat ion.Fields.Item ("http://schemas.microso ft.com/cdo/configuration/sendusername") ="info@server.c om"
objMyConfigurat ion.Fields.Item ("http://schemas.microso ft.com/cdo/configuration/sendpassword") ="password"
objMyConfigurat ion.Fields.Upda te
Set objMyMessage.Co nfiguration = objMyConfigurat ion
strBodyText = "Dear somebody" & vbNewLine
strBodyText = strBodyText &"Thank you," & vbcrlf
strBodyText = strBodyText & "text"
objMyMessage.To = "to@email.c om"
objMyMessage.Fr om = "from@email.com "
objMyMessage.Su bject = "RE: subject"
objMyMessage.TE XTBody = strBodyText
'objMyMessage.S end
Set objMyMessage = Nothing
Set objMyConfigurat ion = Nothing
Response.Write( strBodyText)
%>[/PHP]
Could somebody help me with my code? The problem is - I can't make vbcrlf work for the plain text e-mail. If I am using vbcrlf people getting unformatted text (no new lines). Same as if I preview it in browser using Response.Write( strBodyText) --- see below.
If I use "<br>" instead of vbcrlf than users are getting text displaying <BR> "Dear Name<br>text... ..<br>Thank you, etc"
Please advise how to send plain text e-mail with carriage return correctly.
P.S. I tryed Chr(13), Chr (10), vbnewline - nothing helps.... :(
Thanks
[PHP]<%
Dim objMyMessage, objMyConfigurat ion
Set objMyMessage = Server.CreateOb ject("CDO.Messa ge")
Set objMyConfigurat ion = Server.CreateOb ject ("CDO.Configura tion")
objMyConfigurat ion.Fields("htt p://schemas.microso ft.com/cdo/configuration/sendusing") = 2
objMyConfigurat ion.Fields("htt p://schemas.microso ft.com/cdo/configuration/smtpserver") = "mail.server.co m"
objMyConfigurat ion.Fields("htt p://schemas.microso ft.com/cdo/configuration/smtpserverport" ) = 25
objMyConfigurat ion.Fields("htt p://schemas.microso ft.com/cdo/configuration/smtpusessl") = False
objMyConfigurat ion.Fields("htt p://schemas.microso ft.com/cdo/configuration/smtpconnectiont imeout") = 60
objMyConfigurat ion.Fields("htt p://schemas.microso ft.com/cdo/configuration/smtpauthenticat e") = 1 'basic (clear-text) authentication
objMyConfigurat ion.Fields.Item ("http://schemas.microso ft.com/cdo/configuration/sendusername") ="info@server.c om"
objMyConfigurat ion.Fields.Item ("http://schemas.microso ft.com/cdo/configuration/sendpassword") ="password"
objMyConfigurat ion.Fields.Upda te
Set objMyMessage.Co nfiguration = objMyConfigurat ion
strBodyText = "Dear somebody" & vbNewLine
strBodyText = strBodyText &"Thank you," & vbcrlf
strBodyText = strBodyText & "text"
objMyMessage.To = "to@email.c om"
objMyMessage.Fr om = "from@email.com "
objMyMessage.Su bject = "RE: subject"
objMyMessage.TE XTBody = strBodyText
'objMyMessage.S end
Set objMyMessage = Nothing
Set objMyConfigurat ion = Nothing
Response.Write( strBodyText)
%>[/PHP]
Comment