rockinaway Posted August 7, 2011 Share Posted August 7, 2011 I have a few questions about using the mail() function: 1) How can I have it so that when a person receives an email from my website the 'From' bit just shows the website name and no email address 2) How can I include stylesheets or any kind of styling? 3) Is there any way to prevent emails being filtered out as suspicious or unsafe? I haven't got any malicious information or code so I was wondering what could trigger this to happen? Quote Link to comment https://forums.phpfreaks.com/topic/244141-some-email-questions/ Share on other sites More sharing options...
voip03 Posted August 7, 2011 Share Posted August 7, 2011 for your q1 $headers.= 'From: sitename.com <[email protected]>' ."\r\n"; if you remove '<[email protected]>' will not show any eamil address or you can keep the word no reply. q2. I am not sure CSS can be used. q3. depend on receiver mail setting Quote Link to comment https://forums.phpfreaks.com/topic/244141-some-email-questions/#findComment-1253808 Share on other sites More sharing options...
rockinaway Posted August 7, 2011 Author Share Posted August 7, 2011 Okay thank you. Also do you need to show the x-mailer: php in your headers? Quote Link to comment https://forums.phpfreaks.com/topic/244141-some-email-questions/#findComment-1253811 Share on other sites More sharing options...
voip03 Posted August 7, 2011 Share Posted August 7, 2011 // Send emil with $headers = "MIME-Version: 1.0\r\n"; $headers.= "Content-type: text/html; charset=iso-8859-1\r\n"; $headers.= 'From: site.com <[email protected]>' ."\r\n"; no need to Quote Link to comment https://forums.phpfreaks.com/topic/244141-some-email-questions/#findComment-1253813 Share on other sites More sharing options...
rockinaway Posted August 7, 2011 Author Share Posted August 7, 2011 When I put the headers like that I just get a default email address from the server instead of just the site name, is there anything else i need to do? Quote Link to comment https://forums.phpfreaks.com/topic/244141-some-email-questions/#findComment-1253853 Share on other sites More sharing options...
voip03 Posted August 7, 2011 Share Posted August 7, 2011 $headers.= 'From: site.com <[email protected]>' ."\r\n"; have replace with u sitename? Quote Link to comment https://forums.phpfreaks.com/topic/244141-some-email-questions/#findComment-1253858 Share on other sites More sharing options...
Drummin Posted August 7, 2011 Share Posted August 7, 2011 2) How can I include stylesheets or any kind of styling?Inline styling works fine. Quote Link to comment https://forums.phpfreaks.com/topic/244141-some-email-questions/#findComment-1253860 Share on other sites More sharing options...
rockinaway Posted August 7, 2011 Author Share Posted August 7, 2011 $headers.= 'From: site.com <[email protected]>' ."\r\n"; have replace with u sitename? Yes, I've removed the address bit and put 'From: Sitename' without the email address bit.. Quote Link to comment https://forums.phpfreaks.com/topic/244141-some-email-questions/#findComment-1253879 Share on other sites More sharing options...
Drummin Posted August 7, 2011 Share Posted August 7, 2011 I use headers like this $headers = "From: $siteemail\r\n"; $headers .= "Reply-To: $siteemail\r\n"; $headers .= "Organization: $sitename \r\n"; $headers .= "X-Sender: $siteemail \r\n"; Quote Link to comment https://forums.phpfreaks.com/topic/244141-some-email-questions/#findComment-1253883 Share on other sites More sharing options...
rockinaway Posted August 7, 2011 Author Share Posted August 7, 2011 Does that hide the site email and just show the organisation name? Quote Link to comment https://forums.phpfreaks.com/topic/244141-some-email-questions/#findComment-1253891 Share on other sites More sharing options...
rockinaway Posted August 8, 2011 Author Share Posted August 8, 2011 Any help? Quote Link to comment https://forums.phpfreaks.com/topic/244141-some-email-questions/#findComment-1254136 Share on other sites More sharing options...
voip03 Posted August 8, 2011 Share Posted August 8, 2011 with out @ it will creat problem. Quote Link to comment https://forums.phpfreaks.com/topic/244141-some-email-questions/#findComment-1254139 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.