PHP Mail

AXISHK
AXISHK used Ask the Experts™
on
How to enable mail for PHP ? What should I need to configure on my RedHat and PHP server ?

Tks
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Dave BaldwinFixer of Problems
Most Valuable Expert 2014
Commented:
If you mean the PHP mail() function, all you normally need is a 'sendmail' compatible SMTP server on that machine.  http://php.net/manual/en/function.mail.php  Note that mail() is a very simple minded function.  If you need any kind of authentication to an outside SMTP server, you may want to look at PHPMailer https://github.com/PHPMailer/PHPMailer
Pallavi GodseSr. Digital Marketing Executive
Commented:
Hi,
For a PHP mail function -
> mail() function sends mail directly from script
 
Mail configuration settings -
Name Default Description Changeable
SMTP "localhost" Windows only: The DNS name or IP address of the SMTP server PHP_INI_ALL
smtp_port "25" Windows only: The SMTP port number. Available since PHP 4.3 PHP_INI_ALL
sendmail_from NULL Windows only: Specifies the "from" address to be used in email sent from PHP PHP_INI_ALL
sendmail_path NULL Unix systems only: Specifies where the sendmail program can be found
(usually /usr/sbin/sendmail or /usr/lib/sendmail) PHP_INI_SYSTEM

Hope this will help you.
Ankit PareekOnline Marketing
Commented:
Hi AXISHK

To get the information about PHP mail() function you can check out these Links

www.quackit.com/php/tutorial/php_mail.cfm
www.quackit.com/php/tutorial/php_mail_configuration.cfm

I hope it will work for you
Ensure you’re charging the right price for your IT

Do you wonder if your IT business is truly profitable or if you should raise your prices? Learn how to calculate your overhead burden using our free interactive tool and use it to determine the right price for your IT services. Start calculating Now!

Most Valuable Expert 2011
Top Expert 2016

Commented:
You can learn about your PHP installation by running this script, shown here in its entirety.
<?php phpinfo();

Open in new window

You can search the output for your keywords, in this case, "mail" to see what your PHP settings contain.

Author

Commented:
Tks.
Do I need to enable SMTP service on my local Linux ? There is not SMTP service available on the server.... ?
Just skip the mail() function in php. Use PHPMailer in combination of a good mailserver. Gmail for example is free.

PHPMailer uses any smtp you want with authentication and becouse your sending mails from the right smtp server for that domain. You will not be marked as spam.

Author

Commented:
Tks

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial