PEAR Packages
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Codewalkers ForumsPHP RelatedPEAR Packages

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Codewalkers Forums Sponsor:
  #1  
Old April 17th, 2007, 01:35 PM
Anonymous Anonymous is offline
Registered User
Codewalkers God 35th Plane (22000 - 22499 posts)
 
Join Date: Apr 2007
Posts: 22,309 Anonymous User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 24
PEAR script dies with gmail

Hi

Im using PEAR to connect to gmail and when i run the script it just dies and doesnt mail im not sure why this is but here is my code:

php Code:
Original - php Code
  1.  
  2. <?php
  3.  
  4. require "Mail.php";
  5.  
  6. $from = "username@gmail.com";
  7. $to = "anotherusername@gmail.com";
  8. $subject = "Hi!";
  9. $body = "Hi,nnHow are you?";
  10.  
  11. $host = "smtp.gmail.com";
  12.  
  13. $username = "administrator@mydomain.com";
  14. $password = "mypass";
  15.  
  16. $headers = array ('From' => $from,
  17.   'To' => $to,
  18.   'Subject' => $subject);
  19. $smtp = Mail::factory('smtp',
  20.   array ('host' => $host,
  21.     'port' => 465,
  22.     'localhost' => "68.41.185.216",
  23.     'auth' => TRUE,
  24.     'username' => $username,
  25.     'password' => $password,
  26.     'debug' => TRUE
  27.     ));
  28.  
  29. $mail = $smtp->send($to, $headers, $body);
  30.  
  31. if (PEAR::isError($mail)) {
  32.   echo("<p>" . $mail->getMessage() . "</p>");
  33.  } else {
  34.   echo("<p>Message successfully sent!</p>");
  35.  }
  36. ?>


a link to the script running is
http://watchyourhousesell.com/t.php

Does anyone have any ideas as to why this script dies when it sends the email??


Thanks

Reply With Quote
  #2  
Old April 18th, 2007, 03:44 PM
Ethorsen Ethorsen is offline
Contributing User
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Posts: 8 Ethorsen User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 34 m 34 sec
Reputation Power: 0
RE: PEAR script dies with gmail

I know that gmail smtp requires a secure SSL connection. I havn't check but you should make sure that the pear mail class support it.

Reply With Quote
Reply

Viewing: Codewalkers ForumsPHP RelatedPEAR Packages > PEAR script dies with gmail


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway
Stay green...Green IT