Board index   FAQ   Search  
Register  Login
Board index PHP PEAR and PECL

Pear Mail with special SMTP settings

Do you have questions regarding Pecl or Pear? ask here!

Moderators: macek, egami, gesf

Pear Mail with special SMTP settings

Postby TVirus » Fri Nov 25, 2005 2:54 am

Hi,

I am trying to send an email thrue PEAR Mail v1.1.9.
My problem is that I have to login on my SMTP server... I did this, but I never recieved the email when I check my webmail, but neither did I get a error message when sending any mail.

I tried changing the smtp address to a invalid smtp address, no error there either.

What can I do to fix this problem?

My code:
Code: Select all
   set_include_path("PEAR");
   include("Mail.php");

   $recipients = array('To' => 'Paul.Peelen@bredband.net',
                    'Bcc' => '$bcc',
                    'Cc' => '$cc');

   $headers["From"]    = "Blabla <bla@ratemydekstop.net>";
   $headers["To"]      = "Paul.Peelen@bredband.net";
   $headers["Subject"]   = $subject;

   $params["host"]      = "relay.bostream.com";
   $params["port"]      = "25";
   $params["auth"]      = true;
   $params["username"] = "MYUSERNAME";
   $params["password"] = "MYPASSWORD";

   error_reporting(E_ALL);

   // Create the mail object using the Mail::factory method
   $mail_object =& Mail::factory("smtp", $params);

   $mail_object->send($recipients, $headers, $message)or die("NOOO!");


Best regards,
Paul Peelen
TVirus
New php-forum User
New php-forum User
 
Posts: 23
Joined: Mon Jan 10, 2005 7:28 am
Location: Stockholm

Postby Alexej Kubarev » Fri Nov 25, 2005 3:27 am

Halloy!

Anyways..the thing is that pear mail class is jsut a peace of crap..hehe
I will suggest that you use PHPMailer instead as it has a full support for authentication, both SMTP auth and POP before SMTP

Why reinvent the wheel?
User avatar
Alexej Kubarev
Site Admin
Site Admin
 
Posts: 2223
Joined: Fri Mar 05, 2004 7:15 am
Location: Täby, Stockholms län

Postby TVirus » Fri Nov 25, 2005 4:16 am

Alexei Kubarev wrote:Halloy!

Anyways..the thing is that pear mail class is jsut a peace of crap..hehe
I will suggest that you use PHPMailer instead as it has a full support for authentication, both SMTP auth and POP before SMTP

Why reinvent the wheel?


Thnx m8.

// Paul
TVirus
New php-forum User
New php-forum User
 
Posts: 23
Joined: Mon Jan 10, 2005 7:28 am
Location: Stockholm

Postby Redcircle » Sun Nov 27, 2005 1:26 pm

also here's a smtp mail function

http://expert.no-ip.org/?free=smtp_mail&func
User avatar
Redcircle
Moderator
Moderator
 
Posts: 830
Joined: Tue Jan 21, 2003 10:42 pm
Location: Michigan USA

Postby Alexej Kubarev » Tue Nov 29, 2005 1:40 am

this reminds me: post is moved to the correct forum as some people still cant read before they post
User avatar
Alexej Kubarev
Site Admin
Site Admin
 
Posts: 2223
Joined: Fri Mar 05, 2004 7:15 am
Location: Täby, Stockholms län


Return to PEAR and PECL

Who is online

Users browsing this forum: No registered users and 1 guest

Sponsored by Sitebuilder Web hosting and Traduzioni Italiano Rumeno and antispam for cPanel.

cron