Hi,
I need to send email with attachment on click of a button. We use emails like name@basepost.biz which is assigned to gmail.
I tried the following code but it throws transport to server error.
Dim cdoConfig
Dim msgOne
Set cdoConfig = CreateObject("CDO.Configuration")
With cdoConfig.Fields
.Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = 465
.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "smtp.basepost.biz"
.Item("http://schemas.microsoft.com/cdo/configuration/sendusername") = "name"
.Item("http://schemas.microsoft.com/cdo/configuration/sendpassword") = "password"
.Item("http://schemas.microsoft.com/cdo/configuration/smtpusessl") = True
.Item("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = 1
.Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
.Update
End With
Set msgOne = CreateObject("CDO.Message")
Set msgOne.Configuration = cdoConfig
msgOne.To = "customer@gmail.com"
msgOne.From = "support@basepost.biz"
msgOne.Subject = "Test email"
msgOne.TextBody = "It works just fine third time also"
msgOne.Addattachment "c:\users\..."
msgOne.send
Please advice
I need to send email with attachment on click of a button. We use emails like name@basepost.biz which is assigned to gmail.
I tried the following code but it throws transport to server error.
Dim cdoConfig
Dim msgOne
Set cdoConfig = CreateObject("CDO.Configuration")
With cdoConfig.Fields
.Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = 465
.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "smtp.basepost.biz"
.Item("http://schemas.microsoft.com/cdo/configuration/sendusername") = "name"
.Item("http://schemas.microsoft.com/cdo/configuration/sendpassword") = "password"
.Item("http://schemas.microsoft.com/cdo/configuration/smtpusessl") = True
.Item("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = 1
.Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
.Update
End With
Set msgOne = CreateObject("CDO.Message")
Set msgOne.Configuration = cdoConfig
msgOne.To = "customer@gmail.com"
msgOne.From = "support@basepost.biz"
msgOne.Subject = "Test email"
msgOne.TextBody = "It works just fine third time also"
msgOne.Addattachment "c:\users\..."
msgOne.send
Please advice