| | |
CDOSYS Error
Please support our ASP advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
![]() |
I am trying to send an email using CDOSYS with classic ASP. But I am getting this error:
Can anyone plz help?
Thanx
ASP Syntax (Toggle Plain Text)
CDO.Message.1 error '80040220' The "SendUsing" configuration value is invalid. /send.asp, line 8 line1 <% line2 Dim myMail line3 Set myMail=CreateObject("CDO.Message") line4 myMail.Subject="Sending email with CDO" line5 myMail.From="from@domain.com" line6 myMail.To="to@domain.com" line7 myMail.TextBody="This is a message." line8 myMail.Send line9 set myMail=nothing line10 %>
Can anyone plz help?
Thanx
Try the following code from my AspLib-library of general asp-classes
and asp-functions:
and asp-functions:
asp Syntax (Toggle Plain Text)
sub SendMail( byval psTo, byval psSubject , byval psBody ) '______________________________________________________________________________ ' ' 'Send Mail' '______________________________________________________________________________} Dim iMsg Dim iConf,Flds if psTo = "" then Exit sub Set iMsg = CreateObject("CDO.Message") Set iConf = CreateObject("CDO.Configuration") Set Flds = iConf.Fields With Flds ' assume constants are defined within script file .Item("[url]http://schemas.microsoft.com/cdo/configuration/sendusing[/url]") = 2 .Item("[url]http://schemas.microsoft.com/cdo/configuration/smtpserver[/url]") = <your relay server> .Item("[url]http://schemas.microsoft.com/cdo/configuration/smtpserverport[/url]") = 25 .Update End With With iMsg Set .Configuration = iConf .To = psTo .From = "{#EmailContact}" .Subject = psSubject .ReplyTo = "{#EmailContact}" .BCC = "" ' "{#EmailContact}" '.Importance = cdoNormal 'For body text use either one of below '.TextBody = '' .HTMLBody= psBody '.CreateMHTMLBody "[url]http://www.w3schools.com/asp/[/url]" '.CreateMHTMLBody "[url]file://c:/mydocuments/test.htm[/url] '.AddAttachment "c:\mydocuments\test.txt" ' .MailFormat = 0 ' 0 for html - 1 for plain text ' .BodyFormat = 0 ' 0 for html - 1 for plain text .Send End With set iConf = Nothing set iMsg = Nothing end sub
•
•
Join Date: Nov 2009
Posts: 1
Reputation:
Solved Threads: 0
Try the code posted on:-
http://prabhat.me/2009/11/04/send-e-mail-using-cdo/
http://prabhat.me/2009/11/04/send-e-mail-using-cdo/
![]() |
Similar Threads
- Error Loading operating System (Windows NT / 2000 / XP)
- svchost.exe error (Windows NT / 2000 / XP)
- New Hardware Causing Error (Windows NT / 2000 / XP)
- office 2000 install error (Windows NT / 2000 / XP)
- VMWare Unrecoverable Error (*nix Software)
- Error in Wrox Book (Perl)
Other Threads in the ASP Forum
- Previous Thread: ASP Error
- Next Thread: Need some help
Views: 5683 | Replies: 2
| Thread Tools | Search this Thread |
Tag cloud for ASP
archive asp asp.net aspandmssqlserver2005 aspandmssqlserver2005connection aspconnection calendar changeable connection current database databaseconnection diagnostics dreamweaver excel fso html iis microsoft msmsql mssql2005 mssqlserver2005 mssqlserver2005andasp mssqlserverandasp opentextfile query record searchbox selectoption server single specfic sqlserver sqlserverconnection toolkit update web webserver windows7





