Jump to content

Change email settings in phpinfo()


michaelkirby

Recommended Posts

One caveat: if your ISP's SMTP server requires authentication, you'll need to use a third-party class like PHPMailer, or similar. PHP's mail() function doesn't have the ability to authenticate.

Hi,

 

I found the location of the php.ini file an changed the settings for smtp to the ones of the hosting I have as below>

 

Incoming mail server

POP3: pop.123-reg.co.uk

IMAP: imap.123-reg.co.uk

Outgoing mail server

SMTP: smtp.123-reg.co.uk

 

When I run the mail function I still get the following error:

 

Warning: mail() [function.mail]: Failed to connect to mailserver at "localhost" port 25, verify your "SMTP" and "smtp_port" setting in php.ini or use ini_set() in C:\xampp\htdocs\KomenLtd1\mail.php on line 7

Mail send failure - message not sent

 

Any Ideas at all?

 

Thanks in advance

Hi,

 

After investigation I found that the SMTP requires authentication.

 

I started looking into PHPMailer, however am not managing to get it to work.

 

Instructions I have got so far are to download and extract phpmailer to my htdocs folder and create a new folder called phpmailer. So the overall path is as follows:

 

C:\xampp\htdocs\phpmailer

 

The code I'm using is as follows:

 

<?php
ini_set("include_path", "C:/xampp/htdocs/phpmailer");
require_once("class.phpmailer.php");
$mailer = new PHPMailer();
$mailer->IsSMTP();
$mailer->Host = 'mail.komenltd.co.uk';
$mailer->SMTPAuth = true;

$mailer->Username = '[email protected]';
$mailer->Password = 'Password';
$mailer->FromName = 'Komenltd';
$mailer->From = '[email protected]';
$mailer->AddAddress('[email protected]','Michael Kirby');
$mailer->Subject = 'Test Message';

$mailer->Body = 'Does this work?';

if(!$mailer->Send())
{
echo "Message was not sent";
echo "Mailer Error: " . $mailer->ErrorInfo;
exit;
}
?>

 

but when I run the page I get the following error:

 

Warning: require_once(class.phpmailer.php) [function.require-once]: failed to open stream: No such file or directory in C:\xampp\htdocs\KomenLtd1\mail.php on line 3

 

Fatal error: require_once() [function.require]: Failed opening required 'class.phpmailer.php' (include_path='C:/xampp/htdocs/phpmailer') in C:\xampp\htdocs\KomenLtd1\mail.php on line 3

 

Can anyone help me please?

 

 

 

 

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.