SMTP not working

Post Reply
sadams54
Posts: 14
Joined: Monday 09th July 2018 3:43am

SMTP not working

Post by sadams54 » Monday 16th July 2018 3:07am

You guys are great, helped me solve last problem easy. now this one please. I get an error using smtpclient that says "unable to send recipients, sender rejected" using the code below..

Dim M As New SmtpClient

m.Host = "smtp.mail.yahoo.com"
m.To.Add("mail@txt.att.net")
m.Port = 465
m.From = "Kitchen Timer"
m.Subject = "This is a test"
m.Body = "Testes"
m.User = "user"
m.Password = "password"
m.Encrypt = Net.SSL

m.Send

the mail info is correct and authenticates. Any good help appreciated.

User avatar
cogier
Site Admin
Posts: 192
Joined: Wednesday 21st September 2016 2:22pm
Location: Guernsey, Channel Islands

Re: SMTP not working

Post by cogier » Monday 16th July 2018 8:46am

Try changing m.From and m.User to your email address. e.g.
m.From = "me@yahoo.com"
m.User = "me@yahoo.com"

User avatar
jornmo
Site Admin
Posts: 172
Joined: Wednesday 21st September 2016 1:19pm
Location: Norway

Re: SMTP not working

Post by jornmo » Monday 16th July 2018 9:39am

That was my first thought too.

Post Reply