sending HTML emails / SciBit ASP Mailer

VadimVadim
VadimVadim used Ask the Experts™
on
I am sending out emails which are supposed to be in html format, but somehow they arrive as plain text. Has anyone used ASP Mailer (SciBit soft) for that purpose? Or is it possible to make mass mailings with CDONTS?
Thank you in advance.
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®

Commented:


 VadimVadim,

 I recommend you to used CDONTS mail. It's much easier and free to use. ;o)
 The below is my code snippet for you :-

 <%@Language=VBSCRIPT %>
<%

     Set mail= server.CreateObject("cdonts.newmail")
     
     mail.subject="Thank You for Registering bla..bla.."
     mail.to = "friendEmail@domain.com"
     mail.from = "yourEmail@domain.com"
     mail.BodyFormat = 0
     mail.MailFormat = 0
       
       mail.body= "<html><head><title>" &_
                   "Testing CDONTS Mail</title>"&_
                   "bla..bla.. normal HTML tag can be used."
                   
       mail.send
       Response.Write "The mail has been Send successfully"
%>      

 The above example was tested. It is running succesfully.

 Hope this help,
 
 mugun

Mark FranzProject Manager

Commented:
If they are arriving in plain text it is due to the client side mail reader, that is of course if your messages are being sent as both HTML or Text format...

I use something like this;

strBody = "<!DOCTYPE HTML PUBLIC ""-//W3C//DTD HTML 4.0 Transitional//EN"">" & vbCrLf _
          & "<html>" & vbCrLf _
          & "<head>" & vbCrLf _
          & " <title>"&thePos&" Position</title>" & vbCrLf _
          & " <meta http-equiv=Content-Type content=""text/html; charset=iso-8859-1"">" & vbCrLf _
          & "</head>" & vbCrLf _
          & "<body bgcolor=""#000080"" style=""font-family : verdana, arial, Helvetica, sans-serif; color : #ffffff;"">" & vbCrLf _          
          & fName&",<p>" & vbCrLf _
          & vbCrLf _
          & "This message is a follow-up to the <b>"&thePos&"</b> position which you previously applied for " &theComp&".&nbsp;&nbsp;" & vbCrLf _
          & "</body>" & vbCrLf _
          & "</html>" & vbCrLf

Set objCDO = Server.CreateObject("CDO.Message")

     With objCDO
          .To       = strTo
          .From     = strFrom
          .Subject  = strSubject
          .HtmlBody = strBody
          .Send
     End With
     Set objCDO = Nothing

Read more here; http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnproasp2/html/usingcdofornts.asp
Commented:
With this component you have to :

"Set the SubType property to 1 for a plain text message or 2 for a Html message.  Include the ASPMailer constants file (ASPMailer.inc) in order to use the constants mtPlain and mtHtml in the ASP script."

example;

Set Mailer = Server.CreateObject("SciBit.ASPMailer")
Mailer.Recipients = "someone@yourdomain.com"
Mailer.From = "someone_else@yourdomain.com"
Mailer.SMTPHost = "smtpserver.yourdomain.com"
Mailer.Subject = "Hey you .. hi there! Html mail here."
Mailer.BodyTextFromFile Server.MapPath("\") & "\MailFormSample.htm"
Mailer.SubType = 2 <<<<<<<- THIS IS HTML MAIL.

Hope this help.
Greetings.



Author

Commented:
Thanks, it really helped!
And thanks to everyone!!!!

Commented:
VadimVadim,
  Welcome, you could find this information in the help file supply with this component. Help file is AspMailer.HLP. If for whatever reason you are not able to locate it, then post your email and I will send it to you.

Greetings

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial