Results 1 to 3 of 3

Thread: phpMailer SMTP Problem

Hybrid View

  1. #1
    Join Date
    Dec 2008

    phpMailer SMTP Problem

    Hi I am trying to use phpmailer smtp for some webform but can't get it to work. I use the below script and didn't get any error message but the emails were never received. The whole website is encrypted with SSL. Is there anything addition needed? Any help will be appreciated. thx.

    PHP Code:
                    $mail = new PHPMailer();
    $mail->SMTPAuth true;                              
    $mail->Host 'mail.domain.com';                 
    $mail->Port 25;                                    
    $mail->Username 'smtp@domain.com';               
    $mail->Password 'Password';   
    $mail->SetFrom($email$firstname " " $lastname);
    $mail->Subject  $subject;

    $mail->WordWrap 50;

  2. #2
    Join Date
    Jul 2013
    Voorheesville NY USA
    Do you have error checking turned on?

  3. #3
    Join Date
    Aug 2004
    Check to see if PHPMailer has anything to tell you. Instead of just calling send(), actually check to see if it worked:
    PHP Code:
    if($mail->Send() == false) {
    error_log("PHPMailer::Send() failed:".PHP_EOL.$mail->ErrorInfo);

    (Or die() instead of error_log() if you prefer for initial debugging.)
    "Well done....Consciousness to sarcasm in five seconds!" ~ Terry Pratchett, Night Watch

    How to Ask Questions the Smart Way (not affiliated with this site, but well worth reading)

    My Blog
    cwrBlog: simple, no-database PHP blogging framework

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
HTML5 Development Center

Recent Articles