Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trial![](https://ecs-static.teamtreehouse.com/assets/views/marketing/shared/community-banner-white-47072046c51352fe6a69f5e691ff5700b28bb11d45197d7bdf066d9ea3f72d0c.webp)
![Phil Ellett](https://secure.gravatar.com/avatar/fb27d8f9ba6a348f5a7254dbf0210927?s=96&d=https%3A%2F%2Fecs-static.teamtreehouse.com%2Fassets%2Fcontent%2Fdefault_avatar-445fbbabfc8dc9188fb5967fe43322ee0c3e0dd1e10f378bf8343784af5a13eb.webp&r=pg)
Phil Ellett
20,514 PointsIs it not bad practice to send an email using the user specified FROM address.
If you send a message (even to yourself) using a FROM address which is user specified then the message could be flagged as spam by the receiving server. AntiSPAM mechanisms such as SPF (Sender Policy Framework) can specify which servers are authorized to send mail for a particular domain. If your message is sent by your webserver then this server is NOT going to be on the authorized list and could be flagged as SPAM. Surely the FROM address should be something like webserver@serverdomain.com and the AddReplyTo method can then be used to set the ReplyTo address to the user submitted address so that it can be replied to.
Richard Phelps
2,960 PointsRichard Phelps
2,960 PointsNo, best practice is to use the user specified email address.
Why?... Well let's say the serverdomain.com domain is blacklisted. The AntiSPAM mechanisms will block emails from this domain. Where I work we recently had this exact problem where one of our servers became black listed and AntiSPAM was blocking form submissions because they were coming from domain names on the server. I would say it's best practice to always use the email address specified by the user.