Gettingbetter
Well-known Member
- Joined
- Oct 12, 2004
- Messages
- 602
I am trying to send an email without having to click yes in Outlook (I also don't want to use auto click yes).
Im guessing CDO is my best bet, however when I run the below
I get the following Error message,
Does any one know how to fix this. Maybe my SMTP server is wrong (does anyone know how to get this???)
Im guessing CDO is my best bet, however when I run the below
Code:
Sub MailCDO()
Dim iMsg As Object
Dim iConf As Object
Dim strbody As String
' Dim Flds As Variant
Set iMsg = CreateObject("CDO.Message")
Set iConf = CreateObject("CDO.Configuration")
iConf.Load -1 ' CDO Source Defaults
Set Flds = iConf.Fields
With Flds
.Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "NE-EXCH"
.Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
.Update
End With
strbody = "Hi there"
With iMsg
Set .Configuration = iConf
.To = "Name@emailaddress"
.CC = ""
.BCC = ""
.From = "Name@emailaddress"
.Subject = "Important message"
.TextBody = strbody
.Send
End With
Set iMsg = Nothing
Set iConf = Nothing
End Sub
Run-Time Error '-2147220975 (80040211)':
The message could not be sent to the SMTP server. The error code was 0x800ccc15. The server responce was not available.
Does any one know how to fix this. Maybe my SMTP server is wrong (does anyone know how to get this???)