This is the solution:
- use the codes above to set mail.From = new MailAddress(address, display name)
- in Gmail, go to Mail Settings >> Accounts and Import.
- Add the email account you will use as sender in “Send Mail As”. (tick as Alias)
This works for me
More Related Contents:
- Smtp authentification required [duplicate]
- Sending email in .NET through Gmail
- Sending email through Gmail SMTP server with C#
- Gmail Error :The SMTP server requires a secure connection or the client was not authenticated. The server response was: 5.5.1 Authentication Required
- How to send an e-mail with C# through Gmail
- Send inline image in email
- How to send email in ASP.NET C#
- “The remote certificate is invalid according to the validation procedure.” using Gmail SMTP server
- SmtpException: Unable to read data from the transport connection: net_io_connectionclosed
- 5.7.57 SMTP – Client was not authenticated to send anonymous mail during MAIL FROM error
- How can I make SMTP authenticated in C#
- Sending email with attachments from C#, attachments arrive as Part 1.2 in Thunderbird
- Client is unauthorized to retrieve access tokens using this method Gmail API C#
- C# SmtpClient class not able to send email using gmail
- SMTP and OAuth 2
- SmtpClient with Gmail
- Testing SMTP server is running via C#
- Can’t auth to Gmail smtp via MailMessage & smtpClient
- Send Email via C# through Google Apps account
- GMail SMTP via C# .Net errors on all ports
- Reading emails from Gmail in C#
- Adding an attachment to email using C#
- Setting multiple SMTP settings in web.config?
- Attaching Image in the body of mail in C#
- SmtpClient: A connection attempt failed because the connected party did not properly respond after a period of time
- System.Net.Mail.SmtpException: The SMTP server requires a secure connection or the client was not authenticated
- Sending email through gmail SMTP on GoDaddy [closed]
- how do i get TcpListener to accept multiple connections and work with each one individually?
- SMTP Send is locking up my files – c#
- Sending mail without installing an SMTP server