phpMailer will not connect using SMTP
Posted on
16th Feb 2014 07:03 pm by
admin
I am trying to use phpMailer with smtp:
Code: [Select]$mailer = new PHPMailer();
$mailer->IsSMTP();
$mailer->Mailer = "smtp";
$mailer->SMTPSecure = 'tls';
$mailer->Host = 'smtp.orangehome.co.uk';
$mailer->Port = 25;
$mailer->SMTPAuth = false;
$mailer->Username = 'mail@domain.com';
$mailer->Password = 'password';
$mailer->From = 'mail@domain.com';
$mailer->FromName = 'Me';
$mailer->Body = 'This is the main body of the email';
$mailer->Subject = 'This is the subject of the email';
$mailer->AddAddress('you@domain.com');
if(!$mailer->Send())
{
echo "Message was not sent<br/ >";
echo "Mailer Error: " . $mailer->ErrorInfo;
}
else
{
echo "Message has been sent";
}
I have also tried with googlemail:
Code: [Select]$mailer = new PHPMailer();
$mailer->IsSMTP();
$mailer->Mailer = "smtp";
$mailer->SMTPSecure = 'ssl';
$mailer->Host = 'smtp.gmail.com';
$mailer->Port = 465;
$mailer->SMTPAuth = TRUE;
$mailer->Username = 'mail@domain.com';
$mailer->Password = 'password';
$mailer->From = 'mail@domain.com';
$mailer->FromName = 'Me';
$mailer->Body = 'This is the main body of the email';
$mailer->Subject = 'This is the subject of the email';
$mailer->AddAddress('you@domain.com');
if(!$mailer->Send())
{
echo "Message was not sent<br/ >";
echo "Mailer Error: " . $mailer->ErrorInfo;
}
else
{
echo "Message has been sent";
}
but I get this error message:
Warning: fsockopen() [function.fsockopen]: unable to connect to smtp.orangehome.co.uk:25 (Connection timed out) ...
or the equivalent for gmail
Is there something I'm missing?
PHP Version 5.2.6
PHPMailer - PHP email class Version: 2.3
No comments posted yet
Your Answer:
Login to answer
254
46
Other forums
image upload, resize THEN submit form
Ok so I have a form that requires the user to upload an image, and then do something with that image
Need some ideas as to how to go about sorting this array...
Here's how the array's are created..
Code: <?php
while ($x = readdir($dp)) {
Calender Not Opening
The following code is not loading the javascript calender in another window. It's not doing anything
Undefined Variable: PHP_SELF, pls help
Hi,
Im a newbie on PHP / MySQL programming and Im running a script to search one field on my
Production Order Enterprise Service to Manufacturing Exctn Sys (MES) ???
Hello Experts,
In our current landscape SAP ECC 5.0 is integrated to MES system via PI 7.
Progress bar tracking file downloads
Hey guys, was wondering if there was a way to track how far a file has been downloaded. I know there
Else statement screws up all css
Does anyone know what goes wrong in the process with this php code?
This code seems to be causing
How do I know when getBounds Method is ready to be called.
I have an application that changes out stylesheets client side. Once I change stylesheet the browse
Extracting Long text from message class with parameters
Hi,
I would like to extract the long text from a message class. However, the long text ha
search query in mysql in php problem
my search query wont work, i know, that my codes are correct.please help
Code: [Select]&l