Here you can search and view our site Knowledge Base. To find a specific article, use KB-article number format (ex. KB-1)
Article number: kb-26
Q. What should I do to use SMTP authentication to send mail by PHP?
A. Currently most of CMS and Forum applications support several methods of sending mail. Please refer to application's documentation.
If you are using Mambo or Joomla, just modify configuration.php file and define following lines:
$mosConfig_mailer = 'smtp';
$mosConfig_smtpauth = '1';
$mosConfig_smtphost = 'mail.yourdomain';
$mosConfig_smtppass = 'your password';
$mosConfig_smtpuser = 'SMTP user name';
If you are using application which not supported SMTP authentication you can our script to replace
Mail() function:
In order To change send mail function you must do following steps:
You need modify MailConfigure.php set configure setting for SMTP server, port, username, password, your email address.
Then in each file you need send email need add this line to that PHP file
require_once("MailConfigure.php");
instead of standard mail() function in your PHP file, use Send_mail function
To do it search for "mail(....." in your PHP file.
Replace by following code:
$retrun=Send_mail($from,$name,$subject,$message,1);
Where:
$from
who send this email
$fromname
name who sends this email
$subject
mail subject
$message
mail message
$format
1 html mail format 0 text mail format
$return
true successful false failed
Also you can utilize one of free mail script, for example PHPMailer