I want to send an e-mail through a PHP script in Linux. My code is as follows:
$to = $row[\'EmailID\'];
$subject = \"XYZ\";
$message = \"yes!!!!\";
$from = \"pal
You can specify your SMTP server in your php.ini file
Check this thread for example: http://board.phpbuilder.com/showthread.php?10307560-CONFIGURING-php-ini-%28Setting-the-SMTP%29!!!
If you want to do it inline, you can try changing these settings with ini_set();
Taken from: http://board.phpbuilder.com/showthread.php?10307560-CONFIGURING-php-ini-(Setting-the-SMTP)!!!
smtp= the name of the host where the SMTP server you'll be using is running (whoever's responsible for your network connection should know this) smtp_port= the port on that host the SMTP server is listening on (25 is the conventional choice) sendmail_from= the email address that the sent mail should say it's from
Just configure the above in your php.ini file.
[Edit] to reflect my comment:- if you dont have access to the default php.ini file, you can create one in your webroot and drop this in.
[Edit 2] This does depend on the configuation on the server, most hosts will allow it however.