 |
|
|
| View previous topic :: View next topic |
| Author |
Message |
geoffism
Joined: 17 Apr 2007 Posts: 1
|
Posted: Tue Apr 17, 2007 5:29 pm Post subject: Using PEAR with Gmail |
|
|
Does anyone know how to use googles smtp in my php scripts because i am using Google apps for your domain does anyone have a working script that will allow me to send email with gmail.
This is my current script that doesnt work it takes forever to load and then shows nothing
| Code: |
<?php
require "Mail.php";
$from = "username@gmail.com";
$to = "anotherusername@gmail.com";
$subject = "Hi!";
$body = "Hi,\n\nHow are you?";
$host = "smtp.gmail.com";
$username = "administrator@mydomain.com";
$password = "mypass";
$headers = array ('From' => $from,
'To' => $to,
'Subject' => $subject);
$smtp = Mail::factory('smtp',
array ('host' => $host,
'port' => 465,
'localhost' => "68.41.185.216",
'auth' => TRUE,
'username' => $username,
'password' => $password,
'debug' => TRUE
));
$mail = $smtp->send($to, $headers, $body);
if (PEAR::isError($mail)) {
echo("<p>" . $mail->getMessage() . "</p>");
} else {
echo("<p>Message successfully sent!</p>");
}
?>
|
|
|
| Back to top |
|
 |
TabascoCat
Joined: 06 Sep 2007 Posts: 1 Location: Jpan
|
Posted: Thu Sep 06, 2007 8:25 pm Post subject: |
|
|
| When Net/SMTP.php is confirmed, the attestation seems not to be tried version of PHP5.1.0 orver. |
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|