michaelkirby Posted June 27, 2010 Share Posted June 27, 2010 Hi all, Can someone please advise me how to change the SMTP settings in phpinfo(), as I want to add my provider in instead of localhost. Help!! Thanks in advance Quote Link to comment https://forums.phpfreaks.com/topic/205979-change-email-settings-in-phpinfo/ Share on other sites More sharing options...
premiso Posted June 27, 2010 Share Posted June 27, 2010 You will change it in the php.ini file, which the location should be shown inside of the phpinfo(); Quote Link to comment https://forums.phpfreaks.com/topic/205979-change-email-settings-in-phpinfo/#findComment-1077848 Share on other sites More sharing options...
Pikachu2000 Posted June 27, 2010 Share Posted June 27, 2010 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. Quote Link to comment https://forums.phpfreaks.com/topic/205979-change-email-settings-in-phpinfo/#findComment-1077885 Share on other sites More sharing options...
michaelkirby Posted June 27, 2010 Author Share Posted June 27, 2010 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 Quote Link to comment https://forums.phpfreaks.com/topic/205979-change-email-settings-in-phpinfo/#findComment-1077977 Share on other sites More sharing options...
kenrbnsn Posted June 28, 2010 Share Posted June 28, 2010 Did you restart your webserver after changing the php.ini file? The changes won't take affect until the webserver is restarted. Ken Quote Link to comment https://forums.phpfreaks.com/topic/205979-change-email-settings-in-phpinfo/#findComment-1077993 Share on other sites More sharing options...
michaelkirby Posted June 28, 2010 Author Share Posted June 28, 2010 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? Quote Link to comment https://forums.phpfreaks.com/topic/205979-change-email-settings-in-phpinfo/#findComment-1078370 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.