Hi,
I am send mail using gmail with smtp setting like credential username and password and form address as different , i can send mail.
But if i use office365 ,i cant send mail "From address" as different email.Below i attach screen shot of interface
Using this setting can send mail
can send mail [
^]
But using this cant send mail
[
cant send mail^]
Both email address got inbox,both can send and receive mails.
This is my code
Try
Dim Smtp_Server As New SmtpClient
Smtp_Server.UseDefaultCredentials = True
Smtp_Server.Credentials = New Net.NetworkCredential("noreply@replyinfomail.com","**Password**")
Smtp_Server.Port = "587"
Smtp_Server.EnableSsl = True
Smtp_Server.Host = "smtp.office365.com"
ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls
System.Net.ServicePointManager.ServerCertificateValidationCallback = AddressOf ServerCertificateValidationCallback
Dim e_mail As New MailMessage()
e_mail = New MailMessage()
e_mail.From = New MailAddress("No Reply", "noreply@infomail.com")
e_mail.To.Add("aravind@gmail.com")
e_mail.Subject = "Please ignore is ,Testing Email Sending !"
e_mail.IsBodyHtml = False
e_mail.Body = "Please ignore is ,Testing Email Sending !"
Smtp_Server.Send(e_mail)
MsgBox("Mail Sent")
Catch error_t As Exception
MsgBox(error_t.ToString)
End Try
I am getting this error "550 5.7.60 SMTP; Client does not have permissions to send as this sender"
What I have tried:
i Try to set on/off ssl and UseDefaultCredentials
pls reply me asap
Regards
Aravind