Click here to Skip to main content
15,940,550 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have an issue in my asp.net application. I am using SMTP server credentials to send emails. It includes a hostname smtp.gmail.com, port no=587, username=”somemai...@gmail.com” password=””. I have created a mail message object and set the from and to address to “fr...@gmail.com”,”t...@gmail.com”. I am getting emails, but the from id is always taken as the username ie,somemai...@gmail.com. How it happens? How can I change the email address to fr...@gmail.com?
Posted

You can't change it. Last I checked, GMail doesn't allow you to set the From address different from the account that's being used to send.
 
Share this answer
 
I believe the only real way to do this would be to find an open SMTP relay to use to send the e-mail.
This would not require any form of authentication and so would be able to send the e-mail as being from whoever you wish.
 
Share this answer
 
Comments
Thomas Daniels 14-Jun-13 9:06am    
Yes, but if you do that, your mail would probably move into the Spam folder.

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