Solved

Trying CDO.Message with Windows Hosted Network Solutions, no error, no e-mail is sent?

Posted on 2008-10-12
2
1,204 Views
Last Modified: 2013-12-14
I have used CDO.Message many times with providers (1 and 1, ReadyHosting), but have never had this experience.

I have a "tell a friend" script I am using, but for some reason, I don't get an error but the e-mail is not sent.

Code attached.
Set Mail = Server.CreateObject("CDO.Message")

		Set objConfig = Server.CreateObject("CDO.Configuration") 

		

		'Configuration:

		objConfig.Fields.Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2

		objConfig.Fields("http://schemas.microsoft.com/cdo/configuration/smtpserver")="smtpserver -- verified"

		objConfig.Fields("http://schemas.microsoft.com/cdo/configuration/smtpserverport")=25 

		objConfig.Fields("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate")=1 

		objConfig.Fields("http://schemas.microsoft.com/cdo/configuration/sendusername") = "user@domain"

		objConfig.Fields("http://schemas.microsoft.com/cdo/configuration/sendpassword") = "password"

		objConfig.Fields("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout") = 60

		'Update configuration 

		objConfig.Fields.Update 

		Set Mail.Configuration = objConfig
 

		Mail.From = "valid and verified e-mail address"

		Mail.To = strEmail

		Mail.Subject = strSubject

		strBody = "A message from: " & strSenderEmail & "<br><br>I am sending this to you because I believe this is a website you should check out!<br><br>"

		Mail.HTMLBody = strBody

		On Error Resume Next

		Mail.Send

		If Err.Number <> 0 Then

			Response.Write "An error encountered: " & Err.Description & "<br>"

		Else %>

			&nbsp;&nbsp;Thank you for your help in getting our message out!<br><br>&nbsp;&nbsp;Click Back on your browser or <a href="tell_a_friend.asp">click here to send another e-mail.</a>

		<% End If

Open in new window

0
Comment
Question by:padlake
2 Comments
 
LVL 70

Expert Comment

by:Chris Dent
Comment Utility

If it seems to be successfully delivering to an SMTP server we will need to check the SMTP logs to determine what happened to the message.

Chris
0
 

Accepted Solution

by:
padlake earned 0 total points
Comment Utility
Network Solutions CDOSYS does not require authentication to send e-mail, therefore this question is resolved.
Set myEmail = Server.CreateObject("CDO.Message")

		schemasURL = "http://schemas.microsoft.com/cdo/configuration/"

		With myEmail.Configuration.Fields

		.Item(schemasURL & "sendusing") = 2

		.Item(schemasURL & "smtpserver") = "localhost"

		.Item(schemasURL & "smtpconnectiontimeout") = 10

		.Item(schemasURL & "smtpserverport") = 25

		.Item (schemasURL & "smtpusessl") = False

		.Item (schemasURL & "smtpconnectiontimeout") = 60

		.Update

		End With

		

		myEmail.From = "email@domain.com"

		myEmail.To = strEmail

		myEmail.BCC = "email@domain.com"

		myEmail.Subject = strSubject

		strBody = "A message from: " & strSenderEmail & "<br><br>I am sending this to you because I believe this is a website you should check out!<br><br>"

		strBody = strBody & "I just found <br><br>website domain.com"

		myEmail.HTMLBody = strBody

		On Error Resume Next

		myEmail.Send

		If Err.Number <> 0 Then

			Response.Write "An error encountered: " & Err.Description & "<br>"

		Else %>

			&nbsp;&nbsp;Thank you for your help in getting our message out!<br><br>&nbsp;&nbsp;Click Back on your browser or <a href="tell_a_friend.asp">click here to send another e-mail.</a>

		<% End If

		Set myEmail = Nothing

Open in new window

0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Suggested Solutions

Hello Friends, My friends and relatives always ask me how to delete all the various types of emails at once in our g-mail  or windows live account.  So I researched this topic to find a unique solution to this query.  Here it is for those who do …
#Citrix #Citrix Netscaler #HTTP Compression #Load Balance
Viewers will learn how to connect to a wireless network using the network security key. They will also learn how to access the IP address and DNS server for connections that must be done manually. After setting up a router, find the network security…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now