Cdo.message Trap Error
Contents |
(עברית)المملكة العربية السعودية (العربية)ไทย (ไทย)대한민국 (한국어)中华人民共和国 (中文)台灣 (中文)日本 (日本語) HomeLibraryLearnDownloadsRepositoryCommunityForumsBlog Ask cdo.message error codes a question Quick access Forums home
Vbscript Cdo Message Error Handling
Browse forums users FAQ Search related threads Remove From My cdo error Forums Answered by: How to obtain text error information from CDO.Message call Scripting > The cdo.message.1 the transport failed to connect to the server Official Scripting Guys Forum! Question 0 Sign in to vote I want tocapture the 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 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/co
resources Windows Server 2012 resources Programs MSDN subscriptions Overview Benefits Administrators Students Microsoft Imagine Microsoft Student Partners ISV Startups TechRewards Events Community Magazine Forums Blogs Channel 9 Documentation APIs and reference Dev centers Retired content Samples We’re sorry. The content you requested has been removed. You’ll be auto redirected in 1 second. CDO Library CDO Library Guide Programming Tasks Programming Tasks Handling Errors Handling Errors Handling Errors Accessing Folders Adding Attachments to a Message Changing an Existing Address Entry Checking for New Mail Copying a Message 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 to Another Folder Creating a New Address Book Entry Creating and Sending a Message Customizing a Folder or Message Deleting a Message Filtering Messages in a Folder Handling Errors Improving Application Performance Making Sure the Message Gets There Moving a Message to Another Folder Organizing a Meeting Posting Messages to a Public Folder Reading a Message from the Inbox https://msdn.microsoft.com/en-us/library/ms527204(v=exchg.10).aspx Searching for a Folder Searching for a Message Selecting Recipients from the Address Book Starting a CDO Session Using Addresses Viewing MAPI Properties Working with Conversations Working with Distribution Lists TOC Collapse the table of content Expand the table of content This documentation is archived and is not being maintained. This documentation is archived and is not being maintained. Handling Errors Exchange Server 2003 Topic Last Modified: 2004-06-09 Handling Errors The CDO Library raises exceptions for all errors. When you write Microsoft® Visual Basic® applications that use the CDO Library, use the same run-time error handling techniques that you use in all your Visual Basic applications: the Visual Basic On Error GoTo statement. Note that the error values and error handling techniques vary slightly depending on whether you are using Visual Basic version 4.0 or older versions of Visual Basic for Applications. When you use older versions of Visual Basic for Applications, use the Err function to obtain the status code and the Error$ function to obtain a descriptive error message, as in the
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 http://stackoverflow.com/questions/24317238/unknown-email-code-from-cdo-message-send-method Us Learn more about Stack Overflow the company Business Learn more about hiring http://www.robvanderwoude.com/vbstech_internet_email.php 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 message error send method up 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 = "" cdo.message trap error objCDO.bcc = "" objCDO.Subject = 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
Challenges C# Getting Started Examples Development Software Books KiXtart Getting Started Examples Links Tools Books Perl Getting Started Examples Links Tools Books PowerShell Getting Started Examples Links Tools Books Regular Expressions Getting Started Expressions Examples Links Tools Books Rexx Getting Started Examples OS/2 LAN Server Links Tools Books VBScript & WSH Getting Started VBScript Techniques Examples HTA & WSC Examples Links Tools Books Challenges Technologies WMI Getting Started Examples Links Tools Books ADSI Getting Started Examples Links Tools Books Silent Installs General Windows Installer Specific Software Software Requirements Hardware Requirements Books Batch Files Windows Resource Kits KiXtart Perl PowerShell Regular Expressions Rexx VBScript & WSH C# WMI ADSI HTML, JavaScript & CSS Off-Topic Scripting Tools Batch Utilities Resource Kits Compilers Editors Code Generators Regular Expressions Automation Tools VBScript Add-Ons Visual Studio Printing Tools Inventory Tools Shell Extensions File Viewers Backup Security The making Of... Miscellaneous Tweaks Web Stuff Conversions My Photo Galleries About This Site Disclaimer News FAQ Search What's New Objective Site Policy Your Preferences Credits The Making Of... Contact Failed Mail Donate VBScript Scripting Techniques > Network > Send e-Mail Send e-Mail CDOSYS VBScript Code: WScript.Echo EMail( "John Doe