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
257
54
Other forums
Coding question?
Hey guys, I have a quick question. If I want to make a way for people to pay for health in my game,
PHP referral database. I would like this form to email the referrer.
Okay, Hello I've been trolling for years. This the first time I've ever asked for php help. Normally
problem when runing a funciton
I am trying to connect to database using a funciton in a functions.php
<?php
funct
Read from forum
Haven't written anything forever and I would like to get back.
What I'm trying to do is getting t
Grouping and sorting results
Please help with this query.
I have 2 tables in a database, countires and cities. states look
need help in php variable
i have a php variable on one page
Code: [Select]$lastId = mysql_insert_id($db);
echo $lastId;<
mr8m - reverse document
Friends,
I'm trying to reverse a document held by MIRO, but it reports the message balan
Page doesn't expand for content
Hi. I've been testing a query I made. It's here http://lapr1.6te.net/inquerito.php
The page doesn
Join Query Help
Hi all,
I am having problems with the below code, which we shall call 'my first join query'!
form problem
below in the form action, i've put "test.php?w=$sw&h=$sh" but when i input the for