Jump to content

Change email settings in phpinfo()


michaelkirby

Recommended Posts

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

Link to comment
Share on other sites

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 = 'info@komenltd.co.uk';
$mailer->Password = 'Password';
$mailer->FromName = 'Komenltd';
$mailer->From = 'info@komenltd.co.uk';
$mailer->AddAddress('michaelkirby87@googlemail.com','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?

 

 

 

 

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

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