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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to send HTML emails with ASP classic?

Status
Not open for further replies.

leifoet

Technical User
Jan 31, 2016
206
BE
Until now I also used the following specific CDO-code for this sending.

Code:
myMail.Configuration.Fields.Item _
("[URL unfurl="true"]http://schemas.microsoft.com/cdo/configuration/sendusing")=2[/URL]
'Name or IP of remote SMTP server
myMail.Configuration.Fields.Item _
("[URL unfurl="true"]http://schemas.microsoft.com/cdo/configuration/smtpserver")[/URL] ="relay.webhosting.be"
'Server port
myMail.Configuration.Fields.Item _
("[URL unfurl="true"]http://schemas.microsoft.com/cdo/configuration/smtpserverport")[/URL] _
=25
myMail.Configuration.Fields.Update

Thanks for tips to resolve this inconvenience

I now did a simple test with the following code
Code:
<%
'Dim objMail
Set myMail = Server.CreateObject("CDO.Message")
myMail.From = "info@abc.DD"
myMail.To = "XXXX@YYYYYY.zz"
myMail.Subject = "Test HTML email"

myMail.HTMLBody = "<html><body><h1>Hello</h1><p>This is a test email.</p></body></html>"

myMail.Configuration.Fields.Item("[URL unfurl="true"]http://schemas.microsoft.com/cdo/configuration/sendusing")[/URL] = 2

myMail.Configuration.Fields.Item("[URL unfurl="true"]http://schemas.microsoft.com/cdo/configuration/smtpserver")[/URL] = "smtp-auth.mailprotect.be"
myMail.Configuration.Fields.Item("[URL unfurl="true"]http://schemas.microsoft.com/cdo/configuration/smtpserverport")[/URL] = 465
myMail.Configuration.Fields.Update
myMail.Send
Set myMail = Nothing

However, this test gives the following error :
CDO.Message.1 error '80040213'
The transport failed to connect to the server.
line myMail.Send

Thanks for tips to resolve this inconvenience - are there specific questions I should ask my provider?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top