Cdo.message Send Catch Error
Contents |
(עברית)المملكة العربية السعودية (العربية)ไทย (ไทย)대한민국 (한국어)中华人民共和国 (中文)台灣 (中文)日本 (日本語) HomeLibraryLearnDownloadsRepositoryCommunityForumsBlog Ask a question Quick access Forums home Browse forums cdo.message error codes users FAQ Search related threads Remove From vbscript cdo message error handling My Forums Answered by: How to obtain text error information from cdo error CDO.Message call Scripting > The Official Scripting Guys Forum! Question 0 Sign in to vote I want tocapture the
Cdo.message.1 The Transport Failed To Connect To The Server
text description of a message that is triggered by an error trying to send an email message using CDO.Message in a vbscript. Here is the script: Dim sMessage dim rc sMessage = "press OK to send email" 'Display cdo.message vbscript the text in a messagebox Msgbox sMessage rc=fnSendEmail msgbox "return code from fnsendemail is " & rc wscript.quit rc Function fnSendEmail() 'Create an object of CDO type Set myMail=CreateObject("CDO.Message") 'Enable SSL Authentication myMail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpusessl") = True 'Enable basic smtp authentication myMail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = 1 'Specify Yahoo SMTP server and Port Number myMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpserver")="smtp.mail.yahoo.com" myMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 465 myMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2 'Specify user id and password myMail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/sendusername") = "me@yahoo.com" myMail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/sendpassword") = "mypassword" 'Update the configuration fields myMail.Configuration.Fields.Update 'Specify email properties myMail.Subject = "Sending Email from QTP" myMail.From = "me@yahoo.com" myMail.To = "metoo@insight.rr.com" myMail.CC = "" myMail.BCC = "" myMail.TextBody = "This is the Text Body" 'Send 2 attachments in the mail 'myMail.AddAttachment "D
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up Unknown email code from CDO.Message send method up https://social.technet.microsoft.com/Forums/scriptcenter/en-US/cb4eb074-f00c-4ddc-9047-6d2552271249/how-to-obtain-text-error-information-from-cdomessage-call?forum=ITCG vote 0 down vote favorite 1 I'm trying to send an email via vbscript. Here's my email code: I've hidden the email address of course. In my actual code I'm using a valid email address. Dim objCDO Set objCDO = Server.CreateObject("CDO.Message") objCDO.Configuration.Fields("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "smtp.oa.caiso.com" objCDO.Configuration.Fields("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25 objCDO.Configuration.Fields("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2 objCDO.Configuration.Fields("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout") = 60 objCDO.Configuration.Fields.Update objCDO.To = "abcemail@devnull.com" objCDO.From = Sender objCDO.cc = "" objCDO.bcc = "" objCDO.Subject http://stackoverflow.com/questions/24317238/unknown-email-code-from-cdo-message-send-method = txtSubject objCDO.HTMLBody = Replace(sBody, Chr(10),"
") On Error GoTo 0 On Error Resume Next objCDO.Send If Err.Number <> 0 Then Response.Write "Just after the send command " Response.Write "Err.Number is " & Err.Number & "
" On Error GoTo 0 End If set objCDO = nothing When this code runs I see the following error: Just after the send command Err.Number is -2147220978 Now, when I research this error number there is no reference anywhere for error code -2147220978 In fact, a Google search for the number -2147220978 returns no results at all. Would you have any idea what that odd error code means? email vbscript asp-classic cdo.message share|improve this question edited Jun 19 '14 at 22:53 John Saunders 138k20175321 asked Jun 19 '14 at 22:26 user3669653 6418 Please confirm that you are using ASP Classic, not ASP.NET. –John Saunders Jun 19 '14 at 22:54 add a comment| 3 Answers 3 active oldest votes up vote 3 down vote -2147220978 = 8004020E From CDOSYSERR.h // // MessageId: CDO_E_SENDER_REJECTED // // MessageText: // // The server rejected the sender address. The server response was: %1 // #define CDO_E_SENDER_REJECTED 0x8004020EL Decoding Errors -2147220978 style numbers are 32 bit signed integers,
Unanswered Topics Wrox Programmer Forums > ASP.NET and ASP > ASP 3 Classic ASP Active Server Pages 3.0 > ASP Pro Code Clinic CDO Email Errors not trapped http://p2p.wrox.com/asp-pro-code-clinic/9830-cdo-email-errors-not-trapped-error.html by On Error User Name Remember Me? Password Reminder Password Register Register | FAQ | Members List | Calendar | Today's Posts | Search ASP Pro Code Clinic As of Oct http://forums.iis.net/t/1146380.aspx?using+CDO+Message+ 5, 2005, this forum is now locked. No posts have been deleted. Please use "Classic ASP Professional" at: http://p2p.wrox.com/forum.asp?FORUM_ID=56 for discussions similar to the old ASP Pro Code Clinic or one message error of the other many remaining ASP and ASP.NET forums here. Search Forums Show Threads Show Posts Advanced Search Find All Thanked Posts Go to Page... Welcome to the p2p.wrox.com Forums. You are currently viewing the ASP Pro Code Clinic section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including cdo.message send catch Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free . Thread Tools Display Modes #1 (permalink) February 26th, 2004, 06:04 PM ebycer Registered User Join Date: Feb 2004 Location: , , . Posts: 3 Thanks: 0 Thanked 0 Times in 0 Posts CDO Email Errors not trapped by On Error Hi, I've got a problem where my apps email service is sporadic.Sometimes works like a charm, other times fails miserably. What's supposed to happen is the following: When an e-mail is successfully sent -- exit successfully and do nothing further. When an error occurs on the email Send command 1) Log the error # and description, body, subject, and distribution in a table 2) Generate a message for the user explaining that the e-mail has NOT been sent, but everything else is OK 3) Give them a link to redirect them so they continue
Web Platform Installer Get Help: Ask a Question in our Forums More Help Resources Blogs Forums Home IIS.NET Forums IIS 5 & IIS 6 Classic ASP using CDO.Message using CDO.Message [Answered]RSS 12 replies Last post Nov 04, 2009 06:04 PM by debugmm ‹ Previous Thread|Next Thread › Print Share Twitter Facebook Email Shortcuts Active Threads Unanswered Threads Unresolved Threads Advanced Search Reply santosh.jha.... 6 Posts using CDO.Message Sep 25, 2007 08:34 AM|santosh.jha.net|LINK Hi, I am using CDO.Message object to send message without using configuration setting of the CDO object. It is working on a server I do know the operating system .but it does not work on server running windows 2003. it gievs error in cdoobject.send Will u tell me plz what is the reason .why it runns on a server and not on other .as in both i have nt aspecified the SMTP server . Reply tomkmvp 9756 Posts MVPModerator Re: using CDO.Message Sep 25, 2007 08:49 AM|tomkmvp|LINK it would help for us to know the error message ... Tom Kaminski (former IIS MVP 2002-2010) http://mvp.support.microsoft.com/ Reply santosh.jha.... 6 Posts Re: using CDO.Message Sep 26, 2007 01:22 AM|santosh.jha.net|LINK CDO.Message.1 error '80040213' The transport failed to connect to the server. Now in this I have aspecified the SMTP server but no username and password as the provider didnot provided it. they say only specifying the server name it will work. Reply steve schofi... 5631 Posts MVPModerator Re: using CDO.Message Sep 26, 2007 04:07 AM|steve schofield|LINK Hmm...I suspect if the SMTP service isn't turned on or isn't configured to allow relaying. Verify its listening on port 25, open a command prompt, type in netstat -an -p tcp and see if 0.0.0.0:25 is listening. http://support.microsoft.com/kb/230235is probably the article you want. Here are several other articles from support.microsoft.com http://www.google.com/search?hl=en&q=site%3Asupport.microsoft.com+IIS+smtp Steve Schofield Windows Server MVP - IIS http://iislogs.com/steveschofield http://www.IISLogs.com Log archival solution Install, Configure, Forget Reply santosh.jha.... 6 Posts Re: using CDO.Message Sep 27, 2007 01:53 AM|santosh.jha.net|LINK i have checked the command on my local system and 0.0.0.0.25 is listning but still now i am getting problem .reality is i am unable to take decision that whether my code is wrong or there is fault on server.plz tell me what should i do.I have talked with the provider theydo not have such typeof knowled