Tuesday, 15 May 2012

email - PHP mail() Return-Path Issues -


After going to new hosting, I started to start odd issues.

The PHP Mail () function works only, if I connect the following line with the phf.ini to -f parameter. (If I have to leave the -f parameter, the mail () function will return right but do nothing.)

  [mail function] sendmail_path = "/ usr / sbin / sendmail -t -i However, the following undesirable header causes all messages:  
  return-path:   

I have tried to add the fifth argument for the mail () but it has no effect.

I will highly appreciate your help. thank you in advanced!

To test / change your PHP mail configuration:

open your php [IF you do not know where it is, see below] [Search for line while reading mail function] Add / Change the details of your mail server This can be a local mail server or your ISP's mail server . Save / stop the php.ini file Restart your web server

What the mail settings can look like when you open the php.ini file for the first time:

  [Mail function]; SMTP = Local Host for Win32 only smtp_port = 25; For Win32 only; Sendmail_from = me@example.com; For Unix only you can supply logic as well (default: "sendmail -t -i"); Sendmail_path =   

Additional information is phpinfo () in echo, you can see your PHP configuration details. You can do this by creating a .php file with the following line on it: When you run it in your browser, you will see a complete list of PHP configuration variables. Just search for rows containing php.ini and sendmail_path that you will see the required value to use.

Another idea is that you can use ini_set () to properly configure your mail settings such as

your email Add the following code at the top of the script if your mail script fails.

  // Please specify your mail server - Example: mail example.com. Ini_set ("smtp", "mail.example.com"); // Please specify valid SMTP ports for one SMTP number 25 and 8889. Ini_set ("SMTP_PORT", "25"); // Please specify the return address to use ini_set ('sendmail_from', 'example@YourDomain.com');    

No comments:

Post a Comment