i have phpmailer installed on my localhost and i have the following configuration

	$to_name = "Thomas Anderson";
	$to = "t_andersons@hotmail.com";
	$subject = "Mail Test at ".strftime("%T", time());
	$message = "This is a test.";
	$message = $message;
	$from_name = "Thomas Anderson";
	$from = "t_andersons@hotmail.com";

	$mail = new PHPMailer();

	$mail->IsSMTP();
	$mail->SMTPDebug = 2;
	$mail->Host     = "smtp.gmail.com";
	$mail->Port     = 465;
	$mail->SMTPAuth = true;
	$mail->SMTPSecure = "ssl";
	$mail->Username = "example@gmail.com";
	$mail->Password = "password";

	$mail->FromName = $from_name;
	$mail->From     = $from;
	$mail->AddAddress($to, $to_name);
	$mail->Subject  = $subject;
	$mail->Body     = $message;

	$result = $mail->Send();
	echo $result ? 'Sent' : 'Error';

this works fine

on a different server, i have typed in the same information at admin/settings/smtp and i'm getting the error

"The configuration options have been saved.A test e-mail has been sent to t_andersons@hotmail.com. You may want to check the logs for any error messages." and

"Unable to send e-mail. Please contact the site administrator if the problem persists."

in admin/reports/dblog i'm getting

Type mail
Date Monday, September 12, 2011 - 14:59
User tandersons
Location http://domain.net/admin/settings/smtp
Referrer http://domain.net/admin/settings/smtp
Message Error sending e-mail (from example@gmail.com to t_andersons@hotmail.com).
Severity error
Hostname 70.25.75.104
Operations

i have also created a test page under sites/all/themes/yghhzen/test_page.php and executed the same code above and i'm getting a blank screen. i have also tried

                $to      = 't_andersons@hotmail.com';
                $subject = 'the subject';
                $message = 'hello';
                $headers = 'From: t_andersons@hotmail.com' . "\r\n" .
                    'Reply-To: t_andersons@hotmail.com' . "\r\n" .
                    'X-Mailer: PHP/' . phpversion();

                $rc = mail($to, $subject, $message, $headers);

                if ($rc) {
                  print "Mail successfully sent!<br>";
                }
                else {
                  print "Failed to send mail<br>";
                }

and the page outputs "Failed to send mail"

i don't know if it's the server configuration or some configuration in drupal but i can't get neither mail nor phpmailer to work. i will be greatful if someone can help me with this

Comments

oadaeh’s picture

Status: Active » Closed (won't fix)

This issue is being closed due to Drupal 6 being at the end of its life. If you feel this is still a valid issue for the Drupal 7 compatible branch of this module, feel free to re-open this issue and provide updated information.