CDOSYS Error

Reply

Join Date: Dec 2004
Posts: 234
Reputation: cancer10 is an unknown quantity at this point 
Solved Threads: 0
cancer10's Avatar
cancer10 cancer10 is offline Offline
Posting Whiz in Training

CDOSYS Error

 
0
  #1
May 19th, 2007
I am trying to send an email using CDOSYS with classic ASP. But I am getting this error:

  1. CDO.Message.1 error '80040220'
  2.  
  3. The "SendUsing" configuration value is invalid.
  4.  
  5. /send.asp, line 8
  6.  
  7. line1 <%
  8. line2 Dim myMail
  9. line3 Set myMail=CreateObject("CDO.Message")
  10. line4 myMail.Subject="Sending email with CDO"
  11. line5 myMail.From="from@domain.com"
  12. line6 myMail.To="to@domain.com"
  13. line7 myMail.TextBody="This is a message."
  14. line8 myMail.Send
  15. line9 set myMail=nothing
  16. line10 %>


Can anyone plz help?

Thanx
Reply With Quote Quick reply to this message  
Join Date: May 2007
Posts: 6
Reputation: Sitestepper is an unknown quantity at this point 
Solved Threads: 0
Sitestepper's Avatar
Sitestepper Sitestepper is offline Offline
Newbie Poster

Re: CDOSYS Error - sending mail in asp using cdo

 
0
  #2
Jun 7th, 2007
Try the following code from my AspLib-library of general asp-classes
and asp-functions:
  1. sub SendMail( byval psTo, byval psSubject , byval psBody )
  2. '______________________________________________________________________________
  3. '
  4. ' 'Send Mail'
  5. '______________________________________________________________________________}
  6. Dim iMsg
  7. Dim iConf,Flds
  8. if psTo = "" then Exit sub
  9. Set iMsg = CreateObject("CDO.Message")
  10. Set iConf = CreateObject("CDO.Configuration")
  11. Set Flds = iConf.Fields
  12. With Flds
  13. ' assume constants are defined within script file
  14. .Item("[url]http://schemas.microsoft.com/cdo/configuration/sendusing[/url]") = 2
  15. .Item("[url]http://schemas.microsoft.com/cdo/configuration/smtpserver[/url]") = <your relay server>
  16. .Item("[url]http://schemas.microsoft.com/cdo/configuration/smtpserverport[/url]") = 25
  17. .Update
  18. End With
  19. With iMsg
  20. Set .Configuration = iConf
  21. .To = psTo
  22. .From = "{#EmailContact}"
  23. .Subject = psSubject
  24. .ReplyTo = "{#EmailContact}"
  25. .BCC = "" ' "{#EmailContact}"
  26. '.Importance = cdoNormal
  27. 'For body text use either one of below
  28. '.TextBody = ''
  29. .HTMLBody= psBody
  30. '.CreateMHTMLBody "[url]http://www.w3schools.com/asp/[/url]"
  31. '.CreateMHTMLBody "[url]file://c:/mydocuments/test.htm[/url]
  32. '.AddAttachment "c:\mydocuments\test.txt"
  33. ' .MailFormat = 0 ' 0 for html - 1 for plain text
  34. ' .BodyFormat = 0 ' 0 for html - 1 for plain text
  35. .Send
  36. End With
  37. set iConf = Nothing
  38. set iMsg = Nothing
  39. end sub
Reply With Quote Quick reply to this message  
Join Date: Nov 2009
Posts: 1
Reputation: shant1976 is an unknown quantity at this point 
Solved Threads: 0
shant1976 shant1976 is offline Offline
Newbie Poster

CDO.Message.1 error '80040220'

 
0
  #3
Nov 4th, 2009
Reply With Quote Quick reply to this message  
Reply

Message:



Similar Threads
Other Threads in the ASP Forum


Views: 5683 | Replies: 2
Thread Tools Search this Thread



Tag cloud for ASP
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC