Click here to Skip to main content
15,126,367 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I am trying send an email from vb.net code using smtp.

When i am trying to send an email to any "gmail" account, it is sending successfully.

but when i am trying to send an email to yahoo account, e.g "account.ymail.com"
then unable to receive mail in my yahoo account.

My smtpClient.send method is not throwing any exception and same code is working for gmail.com

i am just changing email address to ymail but it is not working.

What I have tried:

VB
Try
			Dim email3 As New MailMessage
            Dim smtpClient As New SmtpClient("mail client")

            email3.From = New MailAddress("accounts@mail.com")
            email3.To.Add("yahoo_account@yahoo.co.in")

            email3.Subject = "Mail Subject  :=> " + DateAndTime.Now.ToString()
            email3.Body = "Email body testing :=> " + DateAndTime.Now.ToString()
            email3.IsBodyHtml = True
            
            smtpClient = New SmtpClient("mail.client.com", 26)

            smtpClient.UseDefaultCredentials = False
            smtpClient.Credentials = New NetworkCredential("username", "password")
            smtpClient.EnableSsl = False
            smtpClient.Timeout = 100000
            smtpClient.Send(email3)

            MessageBox.Show("Done")



        Catch ex As Exception

            MessageBox.Show(ex.Message.ToString())

        End Try
Posted
Updated 17-Aug-21 3:45am

1 solution

The fact that no exception is being thrown means that the message is being accepted by your mail.client.com server for delivery.

If it's not arriving, and it's not in the "junk" or "spam" folders, then you need to dig into the SMTP logs to find out why. If you're lucky, the logs on mail.client.com should explain the problem; otherwise, you'd need access to the logs on the recipient's Yahoo mailbox.

Without access to the logs, there is no way of knowing why the message has not arrived.
   

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900