• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

How Send email from yahoo (error 424)

marreco

Member
Hi i try send Email from yahoo, but display 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
 

Attachments

  • ErroToSendEmailFromyahoo.jpg
    ErroToSendEmailFromyahoo.jpg
    301.1 KB · Views: 3
You changed the name of your object -- you are using NewMail and then on that line with the error (as well as the one after it) you are using MyMail. Make all the names the same and hopefully it will work.
 
Back
Top