Jump to content

PHP Mail Display Name


oduth

Recommended Posts

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 <ITServiceDesk@Avea.com.tr>' . "\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 <ITServiceDesk@Avea.com.tr>' . "\r\n";

$headers .= 'Content-Type: text/html; charset=UTF-8';

...

...

 

The output:

> From: IT Service Desk <ITServiceDesk@Avea.com.tr> 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?  :shrug:

 

Thanks & Regards.

Link to comment
Share on other sites

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","XYZ@abc.com");

 

$headers = "From: XYZ <XYZ@abc.com>\n";

$headers .= "Content-Type: text/html; charset=UTF-8";

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.