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 
SMTP->SEND works - but nothing ever shows up

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



Joined: 23 Jun 2011
Posts: 5
Location: Colorado, US

PostPosted: Wed Jul 27, 2011 9:11 pm    Post subject: SMTP->SEND works - but nothing ever shows up Reply with quote

Googled "pear remote smtp" - found a script. The script was working when the host was smtp.google.com/mylogin/mypassword - problem is Google limits you to 50/day and that's going to work for ? a month ? 2? (well maybe forever but we hope not). So we contacted NetworkSolutions and they said: Use smtp.oururl.com.netsolmail.net / ourlogin / our password.

The script says "Message successfully sent!" - except it never shows up. No errors etc. When I telnet smtp... 25 and try to connect - "Relay not allowed". NetSol says you're not blocked - and I'm not sure they know what I'm talking about. (one guy asked what php was)

So, question: is there a method to set $DEBUG = verbose x3 in the script?

Thanks
Back to top
View user's profile Send private message
liderbug



Joined: 23 Jun 2011
Posts: 5
Location: Colorado, US

PostPosted: Thu Jul 28, 2011 1:04 am    Post subject: Got answer Reply with quote

I got it to work with the code below. smtp.ourserv.com points to smtp.ourserver.com.netsolmail.net.

1 <?php
2
3 set_include_path ("/home/myhomedir/pear" . PATH_SEPARATOR . "/home/myhomedir/www/" . PATH_SEPARATOR . get_include_pat
4 require "Mail.php";
5
6 $from = "[email protected]";
7 $to = "[email protected]";
8 $body = "Dear Mr. Me
9
10 This is the body...
11
12 ";
13
14 $host = "smtp.ourserver.com";
15 $username = "[email protected]";
16 $password = "*************";
17
18 $subject = "Sending an SMTP email.";
19 $headers = array ('From' => $from,
20 'To' => $to,
21 'Subject' => $subject);
22 $smtp = Mail::factory('smtp',
23 array ('host' => $host,
24 'port' => 587,
25 'localhost' => "the.ip.of.ourserver",
26 'auth' => TRUE,
27 'smtp from' => "smtp.ourserver.com",
28 'username' => $username,
29 'password' => $password,
30 'debug' => FALSE (or TRUE)
31 ));
32
33 $mail = $smtp->send($to, $headers, $body);
34
35 if (PEAR::isError($mail)) {
36 echo("<p>" . $mail->getMessage() . "</p>");
37 }
38
39 ?>
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