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

CDO error - The "SendUsing" configuration value is invalid.

Status
Not open for further replies.

guineamation

Programmer
Jan 29, 2002
58
IL
i'm trying to send email using the CDO object to emails from a DB,
i managed to send a few but the it stopped, now after a few changes i have this code that gives me the error:

CDO.Message.1 error '80040220'
The "SendUsing" configuration value is invalid.
/sendmail/sendmail.asp, line 59

line 59 is the send line.

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

Const cdoSchema = "[URL unfurl="true"]http://schemas.microsoft.com/cdo/configuration/"[/URL]
' Setup server information
objCDO.configuration.Fields.Item(cdoSchema & "smtpserverport")   = 25
objCDO.configuration.Fields.Item(cdoSchema & "sendusing")  		 = cdoSendUsingPort
objCDO.configuration.Fields.Item(cdoSchema & "smtpserver")       = "mail-fwd.dulles19-verio.com"

Server.ScriptTimeout = 180
Session.Timeout = 2.5

 with objCDO
  .From 			= "webmaster@domain.com"
  .To 				= rsSendMail("email")
  .Subject 			= "News "&CStr(now()) 
  .CreateMHtmlBody "[URL unfurl="true"]http://www.domain.com/news.html"[/URL]  
  .Send   '!!!!!!!!!!!!!! Line 59 //////////////////
 End With

any ideas?, i've searched the net, lost of almost and no luck.
 
try altering the with bit..

see below
Code:
Dim objCDOSYSCon 
		'Create the e-mail server object 
		Set objCDOSYSMail = Server.CreateObject("CDO.Message") 
		Set objCDOSYSCon = Server.CreateObject ("CDO.Configuration") 
		'Out going SMTP server 
		'mailsweeper
		'objCDOSYSCon.Fields("[URL unfurl="true"]http://schemas.microsoft.com/cdo/configuration/smtpserver")[/URL] = "IP of SMTP"


		objCDOSYSCon.Fields("[URL unfurl="true"]http://schemas.microsoft.com/cdo/configuration/smtpserverport")[/URL] = 25 
		objCDOSYSCon.Fields("[URL unfurl="true"]http://schemas.microsoft.com/cdo/configuration/sendusing")[/URL] = 2 
		objCDOSYSCon.Fields("[URL unfurl="true"]http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout")[/URL] = 60 
		objCDOSYSCon.Fields.Update 
		'Update the CDOSYS Configuration 
		Set objCDOSYSMail.Configuration = objCDOSYSCon 
		objCDOSYSMail.From = from		
		objCDOSYSMail.To = recipient		
		objCDOSYSMail.Subject = "tester"
		objCDOSYSMail.CreateMHtmlbody "[URL unfurl="true"]http://www.domain.com/news.html"[/URL]
		'Send the e-mail
		objCDOSYSMail.Send
		'Close the server mail object 
		Set objCDOSYSMail = Nothing 
		Set objCDOSYSCon = Nothing

i tried it and works on my test machine...

btw never knew you could send an HTML page as the html body!!
 
also this line
Code:
objCDOSYSMail.CreateMHtmlbody "[URL unfurl="true"]http://www.domain.com/news.html"[/URL]
do it like this so that when the person receives the email they don't receive the elements as attachments

Code:
objCDOSYSMail.CreateMHtmlbody "[URL unfurl="true"]http://www.domain.com/news.html",31[/URL]
 
Thanks nicklieb, it works now...
the thing is that for some reason id doesn't send the email to the whole list, i'll try to work it out and see if i can come up with a writeable error :)

steven290, i'll try to add the change u suggested, it workd fine before, no object attached, but i'll recheck, mybe i overlooked something.
 
OK, it's all good.

I saw the change that you talked about, steven90. Thanks.

The problem with the emails was that because of the test I used only three emails and tried to send multiple emails to the same three.
When I sent multiple emails to different email accounts it worked fine.

Keep up the good work guys.
 
OK ok, not all is good,

all the emails i tried to send to where from my domain, so they passed perfectly, when i tried to send to a list of emails from different domains i got this error message: Error '8004020F'
I know it means: "Failure in obtaining user token", what i don't know is how to fix it. this is actually my original problem, and the reason i made all the changes that generated more errors.

what can i do? someone?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top