marreco
Member
Hi i try send Email from yahoo, but display error.
See my image, dysplay error
See my image, dysplay error
Code:
Sub SendEmailUsingYahoo()
'Font:http://www.learnexcelmacro.com/wp/2011/12/how-to-send-an-email-using-'excel-macro-from-gmail-or-yahoo/#send-mail-yahoo
Dim NewMail As CDO.Message
Set NewMail = New CDO.Message
'Enable SSL Authentication
NewMail.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpusessl") = True
'Make SMTP authentication Enabled=true (1)
NewMail.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = 1
'Set the SMTP server and port Details
'To get these details you can get on Settings Page of your Yahoo Account
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
'Set your credentials of your Gmail Account
NewMail.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/sendusername") = "MyEmailAccount@yahoo.com.br"
NewMail.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/sendpassword") = "MyPassword"
'Update the configuration fields
NewMail.Configuration.Fields.Update
'Set All Email Properties
With NewMail
.Subject = "Test Mail from LearnExcelMacro.com"
.From = "MyEmailAccount@yahoo.com.br"
.To = "Destination@panpahrma.com.br"
.CC = ""
.BCC = ""
.textbody = "Testing send email"
End With
NewMail.Send
MsgBox ("Mail has been Sent")
'Set the NewMail Variable to Nothing
Set NewMail = Nothing
End Sub