PEAR Forum :: PHP Extension and Application Repository

PEAR Forum Forum Index
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
Using PEAR with Gmail

 
Post new topic   Reply to topic    PEAR Forum Forum Index -> Mail
View previous topic :: View next topic  
Author Message
geoffism



Joined: 17 Apr 2007
Posts: 1

PostPosted: Tue Apr 17, 2007 5:29 pm    Post subject: Using PEAR with Gmail Reply with quote

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
View user's profile Send private message
TabascoCat



Joined: 06 Sep 2007
Posts: 1
Location: Jpan

PostPosted: Thu Sep 06, 2007 8:25 pm    Post subject: Reply with quote

When Net/SMTP.php is confirmed, the attestation seems not to be tried version of PHP5.1.0 orver.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    PEAR Forum Forum Index -> Mail All times are GMT + 2 Hours
Page 1 of 1

 
Jump to:  
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



PEAR Forum topic RSS feed 
Powered by phpBB © 2001, 2005 phpBB Group

Provided by Ministry of Web developement

'Actiemonitor' online projectmanagement software