oduth Posted March 6, 2012 Share Posted March 6, 2012 Hi, I have a problem with Mail Display name. I would really appreciate If you could help me with this. A part of my PHP file: ... ... $headers = 'From: IT Service Desk <[email protected]>' . "\r\n"; $headers .= 'Content-Type: text/html; charset=UTF-8'; ... ... Here is the (echo $headers) result: (You can see there is no <e-mail_address> part of headers) From: IT Service Desk Content-Type: text/html; charset=UTF-8 So, my mail could not be sent. I tried this as well; ... ... $headers = 'From: IT Service Desk <[email protected]>' . "\r\n"; $headers .= 'Content-Type: text/html; charset=UTF-8'; ... ... The output: > From: IT Service Desk <[email protected]> Content-Type: text/html; charset=UTF-8 Although the output looks correct, my mail could not be sent once again. What could the possible problems be? Thanks & Regards. Link to comment https://forums.phpfreaks.com/topic/258406-php-mail-display-name/ Share on other sites More sharing options...
dannyb785 Posted March 6, 2012 Share Posted March 6, 2012 This might sound like a dumb question, but is Avea.com.tr the domain that the mail is being sent from? Most servers will only allow mail to be send "as [email protected]" if whatever.com is the domain being sent. Link to comment https://forums.phpfreaks.com/topic/258406-php-mail-display-name/#findComment-1324581 Share on other sites More sharing options...
oduth Posted March 7, 2012 Author Share Posted March 7, 2012 Yes, the domain is avea.com.tr. Actually, below code works fine. ... $headers .= "From: [email protected]\r\n"; ... But not with Display name. Link to comment https://forums.phpfreaks.com/topic/258406-php-mail-display-name/#findComment-1324751 Share on other sites More sharing options...
oduth Posted March 12, 2012 Author Share Posted March 12, 2012 At last, I solved the issue. Just put "ini_set" commands at the top of the code; ini_set ("SMTP","<ip_address>"); ini_set ("sendmail_from","[email protected]"); $headers = "From: XYZ <[email protected]>\n"; $headers .= "Content-Type: text/html; charset=UTF-8"; Link to comment https://forums.phpfreaks.com/topic/258406-php-mail-display-name/#findComment-1326292 Share on other sites More sharing options...
Nuckelsboy Posted March 12, 2012 Share Posted March 12, 2012 Thanks for this, had something similar Link to comment https://forums.phpfreaks.com/topic/258406-php-mail-display-name/#findComment-1326360 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.