Hi,
Please see the following code I am trying to use to send a simple email. I am getting the following error message: Run-time error '-2147220973 (80040213)' The transport failed to connect the server. What could be the problem?
Thanks,
MG.
Please see the following code I am trying to use to send a simple email. I am getting the following error message: Run-time error '-2147220973 (80040213)' The transport failed to connect the server. What could be the problem?
Code:
[SIZE=3][FONT=Times New Roman]Dim objEmail, toemail, schema[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman]schema = "http://schemas.microsoft.com/cdo/configuration/"[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman]Set objEmail = Create Object("CDO.Message") [COLOR=red]'The space between Create and Object is on purpose. Otherwise the text editor of this forum gives an error.[/COLOR][/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman]With objEmail[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman].From = "ABCD@yahoo.com"[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman].To = "XYZ@yahoo.com"[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman].Subject = "Test Mail"[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman].Textbody = "The quick brown fox " & Chr(10) & "jumps over the lazy dog"[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman]With .Configuration.Fields[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman].Item(schema & "sendusing") = 2[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman].Item(schema & "smtpserver") = "smtp.mail.yahoo.com"[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman].Item(schema & "smtpserverport") = 25[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman].Item(schema & "smtpauthenticate") = 1[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman].Item(schema & "sendusername") = "ABCD"[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman].Item(schema & "sendpassword") = "abcd"[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman]End With[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman].Configuration.Fields.Update[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman].Send[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman]End With[/FONT][/SIZE]
Thanks,
MG.