Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
Old 01-14-2011, 05:36 AM phpmailer problem
Super Talker

Posts: 134
Trades: 0
i'm using phpmailer for sending email with my gmail account.

sometimes i'm getting the error could not authenticate.

is there a solution for it?
__________________

Please login or register to view this content. Registration is FREE

Check out the Facebook Clone build with Jcow SNS at
Please login or register to view this content. Registration is FREE
, it is free and it always will be
Falcone is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 01-14-2011, 09:39 AM Re: phpmailer problem
NullPointer's Avatar
Will Code for Food

Posts: 2,815
Name: Matt
Location: Irvine, CA
Trades: 0
Post your code and any error messages you're getting.
__________________

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
NullPointer is online now
Reply With Quote
View Public Profile Visit NullPointer's homepage!
 
Old 01-14-2011, 09:52 AM Re: phpmailer problem
Super Talker

Posts: 134
Trades: 0
Code:
 $mail = new PHPMailer(true); 
 
 $mail->IsSMTP();
 
 try {
  $mail->SMTPSecure = 'ssl';
  $mail->Host       = $config['smtp_host']; // = 'smtp.gmail.com'
  $mail->SMTPAuth   = $config['smtp_auth'];  // = true             
  $mail->Port       = $config['smtp_port'];       // = 465           
  $mail->Username   = $config['smtp_user']; 
  $mail->Password   = $config['smtp_pass'];
  $mail->IsHTML   = $config['smtp_html']; //=true
  $mail->Subject    = $subject; 
  $mail->SetFrom($config['smtp_from'], get_gvar('site_name'));
  $mail->AddReplyTo($config['smtp_from'], get_gvar('site_name'));
  $mail->AddAddress($to);
  $mail->MsgHTML($message);
 
  return $mail->Send();
 }
 catch (phpmailerException $e) {   
  send_note(1, $e->errorMessage()); //Pretty error messages from PHPMailer 
 } 
 catch (Exception $e) {   
  echo send_note(1,$e->getMessage()); //Boring error messages from anything else! 
 }
error: SMTP Error: Could not authenticate

the error happens sometime, not all the time.
__________________

Please login or register to view this content. Registration is FREE

Check out the Facebook Clone build with Jcow SNS at
Please login or register to view this content. Registration is FREE
, it is free and it always will be
Falcone is offline
Reply With Quote
View Public Profile
 
Old 01-14-2011, 10:14 PM Re: phpmailer problem
Super Spam Talker

Posts: 879
Name: Paul W
Trades: 0
Are you sending from local machine or a hosted site? Can you get full text for the error.
__________________

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE


*** New:
Please login or register to view this content. Registration is FREE
PaulW is offline
Reply With Quote
View Public Profile
 
Old 01-15-2011, 05:52 AM Re: phpmailer problem
Super Talker

Posts: 134
Trades: 0
from a hosted site. from the local computer untill now no problems.

and that is the error code i get.
__________________

Please login or register to view this content. Registration is FREE

Check out the Facebook Clone build with Jcow SNS at
Please login or register to view this content. Registration is FREE
, it is free and it always will be
Falcone is offline
Reply With Quote
View Public Profile
 
Old 01-15-2011, 04:40 PM Re: phpmailer problem
Super Spam Talker

Posts: 879
Name: Paul W
Trades: 0
Several things can cause "SMTP Error: Could not authenticate" - it usually comes with more info. Does it sometimes work and sometimes not if you send repeatedly to the same recipient? Are you checking correctness of recipient? Can you note the date/time it next fails and ask your host what the mail server log says for whoever you're sending to. Given it's intermittent I'd look at the variables - which is recipient or mail server itself - eg if it's busy at certain times.
__________________

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE


*** New:
Please login or register to view this content. Registration is FREE
PaulW is offline
Reply With Quote
View Public Profile
 
Old 01-19-2011, 08:56 AM Re: phpmailer problem
Super Talker

Posts: 134
Trades: 0
Quote:
Originally Posted by PaulW View Post
Several things can cause "SMTP Error: Could not authenticate" - it usually comes with more info. Does it sometimes work and sometimes not if you send repeatedly to the same recipient? Are you checking correctness of recipient? Can you note the date/time it next fails and ask your host what the mail server log says for whoever you're sending to. Given it's intermittent I'd look at the variables - which is recipient or mail server itself - eg if it's busy at certain times.
let's say the mail server is busy. What can you do about it to eliminate this kind of errors.
__________________

Please login or register to view this content. Registration is FREE

Check out the Facebook Clone build with Jcow SNS at
Please login or register to view this content. Registration is FREE
, it is free and it always will be
Falcone is offline
Reply With Quote
View Public Profile
 
Old 01-19-2011, 09:05 AM Re: phpmailer problem
Super Spam Talker

Posts: 879
Name: Paul W
Trades: 0
Messages should usually be queued even if the mail server is busy. What I should have said was "if the machine that the mail server runs on " -- ie if it's competing for scarce resources. Have a word with your hosting company if it's happening too frequently (though it sounds like it is already if you've noticed in testing one script).
__________________

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE


*** New:
Please login or register to view this content. Registration is FREE
PaulW is offline
Reply With Quote
View Public Profile
 
Old 01-21-2011, 10:16 AM Re: phpmailer problem
Junior Talker

Posts: 3
Trades: 0
it seems you are sending too many emails in a speedy way thats the reason you are getting errors
same thing happened to me when i try to send out too many
desklancer.com is offline
Reply With Quote
View Public Profile Visit desklancer.com's homepage!
 
Reply     « Reply to phpmailer problem
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.27923 seconds with 12 queries