Problem
I used your code to my PC which is connected with modem.
I tried to send email with the following code but I received the error: "The server rejected one or more recipient addresses. The server response was: 550 not local host hotmail.com, not a gateway"
Which is my wrong?
Public Function SendEMail_CDO(strFrom, strTo, strCC, strSubject, strBody)
On Error GoTo ErrorHandling
Dim mail
Dim config
Dim fields
Set mail = CreateObject("CDO.Message")
Set config = CreateObject("CDO.Configuration")
Set fields = config.fields
With fields
.Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2 ' SMTP SERVER
.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "mail.itsi.gr" ' IP OF SERVER
.Item("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout") = 10
.Update
End With
Set mail.Configuration = config
With mail
.From = strFrom
.To = strTo
.CC = strCC
.Subject = strSubject
.TextBody = strBody
.Send
End With
Set mail = Nothing
Set fields = Nothing
Set config = Nothing
ErrorHandling:
Debug.Print Err.Description
End Function