PHP Coding
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me



Go Back   Codewalkers ForumsPHP RelatedPHP Coding

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:
Old January 23rd, 2013, 02:34 PM
elim elim is offline
Registered User
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Jan 2013
Posts: 4 elim User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 8 m 22 sec
Reputation Power: 0
php5 - PHPMailer trouble

I'm working on a Mac OS snow leopard laptop.

I have a win2003 server runing email server and I can send emails from my laptop via that mail server. Also I have mybb test forum installed on the laptop that can send emails via my win2003 server (with non ssl connection).

But I have trouble using PHPMailer scripts send emails. Although I used smtp auth, set the username and password in my mail script. It just not working.

The problem is that the script not even show any error msg.

So my question is: How to debug PHPMailer script? At least how to show the errors?

Thanks for your help

Reply With Quote
Old January 24th, 2013, 01:56 PM
elim elim is offline
Registered User
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Jan 2013
Posts: 4 elim User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 8 m 22 sec
Reputation Power: 0
I made some progress: on windows, it work well, but the same testing code not working on my osx snow leopard:

Invalid address: me@mydomain address: me@mydomainInvalid address: him@hisdomainMailer Error: You must provide at least one recipient email address.

where me@mydomain and him@hisdomain represent the email addresses I provided. Thay worked well under windows (I got the mail), but on snow leopard, it gave me strange msg with no new line....

Anyone used PHPMailer with snow leopard and PHP Version 5.3.15?

Reply With Quote
Old January 24th, 2013, 02:11 PM
DavidMR's Avatar
DavidMR DavidMR is offline
Contributing User
Codewalkers Beginner (1000 - 1499 posts)
 
Join Date: Apr 2007
Location: Galway
Posts: 1,439 DavidMR User rank is Lance Corporal (50 - 100 Reputation Level)DavidMR User rank is Lance Corporal (50 - 100 Reputation Level)DavidMR User rank is Lance Corporal (50 - 100 Reputation Level) 
Time spent in forums: 1 Month 3 Days 20 h 47 m 34 sec
Reputation Power: 8
code samples would make it easier to help...
__________________
When I die, I want to go peacefully like my Grandfather did, in his sleep -- not screaming, like the passengers in his car.

Reply With Quote
Old January 24th, 2013, 05:57 PM
elim elim is offline
Registered User
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Jan 2013
Posts: 4 elim User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 8 m 22 sec
Reputation Power: 0
Thanks a lot DavidMR! Here is the code:

The code
There 3 files total in a folder mlr, put the folder to webserver document root and let the browser point to
http://localhost/mlr/smtp_basic.php
you can then see the result.

On my snow leopard, the error msg is
Code:
Invalid address: developer@advisors-online.comInvalid address: developer@advisors-online.comInvalid address: tster@advisors-online.comMailer Error: You must provide at least one recipient email address.


while on my xp system, it said
Code:
.....
Message sent!


The code of smtp_basic.php is:

Code:
<html>
<head>
<title>PHPMailer - SMTP basic test with authentication</title>
</head>
<body>

<?php

//error_reporting(E_ALL);
error_reporting(E_STRICT);

date_default_timezone_set('America/Denver');

require_once('class.phpmailer.php');
//include("class.smtp.php"); // optional, gets called from within class.phpmailer.php if not already loaded

$mail             = new PHPMailer();

$mail->IsSMTP(); // telling the class to use SMTP
$mail->Host       = "elinkage.net"; // SMTP server
$mail->SMTPDebug  = 2;                     // enables SMTP debug information (for testing)
                                           // 1 = errors and messages
                                           // 2 = messages only
$mail->SMTPAuth   = true;                  // enable SMTP authentication
$mail->Host       = "advisors-online.com"; // sets the SMTP server
$mail->Port       = 25;                    // set the SMTP port for the GMAIL server
$mail->Username   = "developer@advisors-online.com"; // SMTP account username
$mail->Password   = "caicaikan";        // SMTP account password
$mail->ContentType = 'fext/plain';
$mail->IsHTML(false);

$mail->SetFrom('developer@advisors-online.com', 'Developer ADV');
$mail->AddReplyTo('developer@advisors-online.com', 'Developer ADV');

$mail->Subject    = "PHPMailer Test Subject via smtp, basic with authentication";
$mail->Body    = "Testing msg....\nPlease ignore.........";

$address = "tster@advisors-online.com";
$mail->AddAddress($address, "Tester ADV");

if(!$mail->Send()) {
  echo "Mailer Error: " . $mail->ErrorInfo;
} else {
  echo "Message sent!";
}

?>

</body>
</html>

Reply With Quote
Old January 24th, 2013, 06:02 PM
elim elim is offline
Registered User
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Jan 2013
Posts: 4 elim User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 8 m 22 sec
Reputation Power: 0
Sorry not the code link not working above for some reason... Here:

advisors-online DOT COM / mlr.zip

Reply With Quote
Old January 25th, 2013, 04:13 AM
DavidMR's Avatar
DavidMR DavidMR is offline
Contributing User
Codewalkers Beginner (1000 - 1499 posts)
 
Join Date: Apr 2007
Location: Galway
Posts: 1,439 DavidMR User rank is Lance Corporal (50 - 100 Reputation Level)DavidMR User rank is Lance Corporal (50 - 100 Reputation Level)DavidMR User rank is Lance Corporal (50 - 100 Reputation Level) 
Time spent in forums: 1 Month 3 Days 20 h 47 m 34 sec
Reputation Power: 8
so to confirm, you say its sent on XP, does the email deliver or just say it sent?

Reply With Quote
Reply

Viewing: Codewalkers ForumsPHP RelatedPHP Coding > php5 - PHPMailer trouble


Developer Shed Advertisers and Affiliates


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 | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.

© 2003-2014 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap