Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    Senior Coder
    Join Date
    May 2004
    Posts
    1,466
    Thanks
    15
    Thanked 0 Times in 0 Posts

    problem sending email

    PHP Code:
    <?
    error_reporting
    (E_ERROR E_WARNING E_PARSE);


    $email "ec@adddd.com";
    $to $email;
    $subject "test";
    $body "Pleatest  audio";

    require(
    "class.phpmailer.php");

    $mail = new PHPMailer();

    $mail->IsSMTP();                                   // send via SMTP
    $mail->Host     "mail.t.com"// SMTP servers
    $mail->SMTPAuth true;     // turn on SMTP authentication
    $mail->Username "mail@ti.com";  // SMTP username
    $mail->Password "mail12"// SMTP password

    $mail->From     "info@t.com";
    $mail->FromName "Ti";
    $mail->AddAddress($email); 


    $mail->WordWrap 50;                              // set word wrap

    $mail->IsHTML(true);                               // send as HTML

    $mail->Subject  $subject;
    $mail->Body     =  $body;

    echo 
    "here";
    if(!
    $mail->Send())
    {
       echo 
    "Message was not sent <p>";
       echo 
    "Mailer Error: " $mail->ErrorInfo;
       exit;
    }
    echo 
    "here2";
    echo 
    "message setn";

     
    ?>
    this is not working
    i'm not getting a mailerror -- the last echo itechos is here (but not the here2) and no email gets sent

    Please advise.

  • #2
    God Emperor Fou-Lu's Avatar
    Join Date
    Sep 2002
    Location
    Saskatoon, Saskatchewan
    Posts
    16,994
    Thanks
    4
    Thanked 2,662 Times in 2,631 Posts
    This is a problem with you're actual PHPMailer class, and not with you're usage of it. It could be a code error or a configuration problem.
    If I had to guess, the Send function is tossing a muted exception thats terminating you're script (preventing the following code from executing). Check PHPMailer::Send() to see if it includes any required arguments that you're missing, if its generating a die or throwing an exception. You may receive more information if you use E_ALL for you're error reporting - right now you're just running against E_ERROR, E_WARNING, and E_PARSE.
    PHP Code:
    header('HTTP/1.1 420 Enhance Your Calm'); 
    Been gone for a few months, and haven't programmed in that long of a time. Meh, I'll wing it ;)


  •  

    Posting Permissions

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