Page 1 of 1

PHPMailer (please help)

Posted: Thu Sep 01, 2005 10:27 am
by Mohammad
Hello

I'm trying to send email via php, first thing I tried was the PHP Mailer class, I would like to log into my gmail account and then send an email from that to anyone I want, that is not possible since PHP mailer doesnt support or have SSL I guess, and it cant login into my gmail account.

but I use the code below to send an email message to anyone I want, also specifying the sender to anyone one I want as well (this is totaly spamming!!).

Code: Select all

<?php
require(''class.phpmailer.php'');

$mail = new PHPMailer();
$mail->IsSMTP(); // telling the class to use SMTP
$mail->Host = ''localhost''; // SMTP server

$mail->From = ''anyone@somedomain.com'';
$mail->FromName = ''anyone'';
$mail->AddAddress(''reciever@somedomain.com'');

$mail->Subject = ''Hello'';
$mail->Body = ''Just Testting
$mail->WordWrap = 50;

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

echo ''Message has been sent'';

?>
the thing with the above code is, if it is sent to a gmail account, the recipent recieves it instantly, but for other accounts such as yahoo or hotmail, it might get through after 12-24 hours, sometimes it goes through instantly.

First, of all I want to know why is this happening, and what is email relaying??

any other ways for sending php mail from a personal account like my personal Gmail by logging into it?

thanx in advance


feyd | Please use

Code: Select all

and

Code: Select all

tags where approriate when posting code. Read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url][/color]