Click here to Skip to main content
16,016,489 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
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
VB
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
Posted
Updated 25-Mar-17 8:46am
v3
Comments
Richard MacCutchan 25-Mar-17 5:54am    
Your links do not point to the right places.
Aravindba 25-Mar-17 6:24am    
i am very very sorry, now updated link and its error msg.
Thanks

What part of "Client does not have permissions to send as this sender" is difficult to understand?

You cannot send an email as someone else from Exchange. Not unless the admins have given you permission to impersonate someone other Exchange user.
 
Share this answer
 
Comments
Aravindba 26-Mar-17 22:32pm    
Already give permission and form specific server we set can send email without Credentials,but even cant send mail.i mean without email and its password can send mail.
Dave Kreskowiak 26-Mar-17 23:35pm    
Is the account you're trying to as a member of the Exchange server? If not, you Exchange will not allow you to impersonate that account.
Aravindba 28-Mar-17 5:04am    
hi,yes,got exchange server,we created an smtp server connector on exchange online to allow direct relay of email from specific server.
Even we enable 587 for all outbound SES setting
Dave Kreskowiak 28-Mar-17 6:36am    
Which has absolutely nothing to do with the question I asked.
First of all, do you own that domain "replyinfomail.com"? If not, that consider spoofing/spamming and violating the Sender Policy Framework (SPF). The SMTP server doing the right thing by compliance with proposed standard RFC 7208 and blocking unauthorized user to sent email using the domain "replyinfomail.com". Please don't do that again.

Sender Policy Framework (SPF)for Authorizing Use of Domains in Email[^]
Sender Policy Framework - Wikipedia[^]
 
Share this answer
 
Comments
Aravindba 25-Mar-17 21:03pm    
hi, for an example i gave that email,that is not correct email or working one.if i use gmail smtp setting i can send email,that's y i put example office365 email.
Bryian Tan 25-Mar-17 21:46pm    
Good to know. Thanks for sharing. I hope you get the answer you looking for.

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



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