www.webdeveloper.com
Results 1 to 3 of 3

Thread: phpMailer SMTP Problem

  1. #1
    Join Date
    Dec 2008
    Posts
    134

    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->IsSMTP(); 
            
    $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->AddAddress($contact);
            
    $mail->Subject  $subject;
            
    $mail->MsgHTML($message);

            
    $mail->WordWrap 50;
            
    $mail->Send(); 

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

  3. #3
    Join Date
    Aug 2004
    Location
    Ankh-Morpork
    Posts
    19,338
    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.)
    "Please give us a simple answer, so that we don't have to think, because if we think, we might find answers that don't fit the way we want the world to be."
    ~ Terry Pratchett in Nation

    eBookworm.us

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