SitePoint Sponsor

User Tag List

Results 1 to 16 of 16

Hybrid View

  1. #1
    SitePoint Wizard lukeurtnowski's Avatar
    Join Date
    Mar 2003
    Location
    Coronado
    Posts
    1,666
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)

    PHPMailer error?

    I have a php page which should send me an email (to my gmail account) but I get an error which I am stuck on
    Mailer Error: Language string failed to load: recipients_failedadmin1sdasp@gmail.com
    Does it mean anything to you?
    Thanks...
    "Oh, and Jenkins--apparently your mother died this morning."

  2. #2
    $this->toCD-R(LP); vinyl-junkie's Avatar
    Join Date
    Dec 2003
    Location
    Federal Way, Washington (USA)
    Posts
    1,524
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Does your script work with other email accounts, or is it just failing with your gmail account? Also, it might be helpful if you showed us some code.
    Music Around The World - Collecting tips, trade
    and want lists, album reviews, & more
    Showcase your music collection on the Web

  3. #3
    SitePoint Wizard lukeurtnowski's Avatar
    Join Date
    Mar 2003
    Location
    Coronado
    Posts
    1,666
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)

    my bad

    Yes, it was workiong fine with mail(), but because I wanted th add 6 attachments I was told to use php mailer,
    heres the php code
    PHP Code:
     
     
    require("class.phpmailer.php");
     
     
    $mail = new PHPMailer();
     
    $mail->IsHTML(true);       // send as HTML 
     
    $mail->IsSMTP(); // telling the class to use SMTP
     
    $mail->Host "smtp.gmail.com"// SMTP server
     
     
    $mail->Username "admin1sdasp";
     
    $mail->Password "ddd";
     
     
    $mail->From $ASP_Email;
     
    $mail->FromName $ASP_Name;
     
    $mail->AddAddress("admin1sdasp@gmail.com""SDASP Administrator");
     
     
    $mail->Subject "SDASP PROVIDER APPLICATION";
     
     
    $message "These are the values that a user has tried to submit<br />";
     
    $message .= '<form method=post action="http://testing.scasp.com/update_table_provider.php"><br />';
     
    $message .= 'ASP Real Name: <input type="text" name="Real_Name" value="' $Real_Name '"><br />'
     
    ...
     ...
     ...
     
    $message .= 'Attachment 5: <input type="text" name="Image5" value="' $Image5 '"><br />';
     
    $message .= 'Attachment 6: <input type="text" name="Image6" value="' $Image6 '"><br />';
     
     
    $mail->Body $message;
     
    //add atttachments
     
    $mail->AddAttachment($Image1_name);
     
    $mail->AddAttachment($Image2_name);
     
    $mail->AddAttachment($Image3_name);
     
    $mail->AddAttachment($Image4_name);
     
    $mail->AddAttachment($Image5_name);
     
    $mail->AddAttachment($Image6_name); 
     
     if(!
    $mail->Send())
     {
        echo 
    "<p>Message was not sent</p>";
        echo 
    "<p>Mailer Error: " $mail->ErrorInfo."</p>";
        echo 
    "<p>Please notify admin at admin@scasp.com</p>";
     }
     else
     {
        echo 
    "<p>Message has been sent, please allow 24 hours for you web site to be up, thank you.</p>";
     } 
    And heres the page that runs it
    http://scasp.com/testing/request.php
    Thanks
    "Oh, and Jenkins--apparently your mother died this morning."

  4. #4
    $this->toCD-R(LP); vinyl-junkie's Avatar
    Join Date
    Dec 2003
    Location
    Federal Way, Washington (USA)
    Posts
    1,524
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    The readme documentation shows the following formats for attachments:

    $mail->AddAttachment("/var/tmp/file.tar.gz"); // add attachments
    $mail->AddAttachment("/tmp/image.jpg", "new.jpg"); // optional name
    Is that the format for the attachments you're trying to use? Put some echo statements in your script just to verify:

    Code:
    echo "Attachment 1: ".$Image1_name."<br>";
    echo "Attachment 2: ".$Image2_name."<br>";
    echo "Attachment 3: ".$Image3_name."<br>";
    echo "Attachment 4: ".$Image4_name."<br>";
    echo "Attachment 5: ".$Image5_name."<br>";
    echo "Attachment 6: ".$Image6_name."<br>";
    Music Around The World - Collecting tips, trade
    and want lists, album reviews, & more
    Showcase your music collection on the Web

  5. #5
    SitePoint Wizard lukeurtnowski's Avatar
    Join Date
    Mar 2003
    Location
    Coronado
    Posts
    1,666
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)
    Yes, but I'm trying to attach something thats an upload button to the user, which I use php to make a variable
    PHP Code:
       // Obtain file upload vars
       
    $Image1      $_FILES['Image1']['tmp_name'];
       
    $Image1_type $_FILES['Image1']['type'];
       
    $Image1_name $_FILES['Image1']['name'];
       
    $Image2      $_FILES['Image2']['tmp_name'];
       
    $Image2_type $_FILES['Image2']['type'];
       
    $Image2_name $_FILES['Image2']['name'];
       
    $Image3      $_FILES['Image3']['tmp_name'];
       
    $Image3_type $_FILES['Image3']['type'];
       
    $Image3_name $_FILES['Image3']['name'];
       
    $Image4      $_FILES['Image4']['tmp_name'];
       
    $Image4_type $_FILES['Image4']['type'];
       
    $Image4_name $_FILES['Image4']['name'];
       
    $Image5      $_FILES['Image5']['tmp_name'];
       
    $Image5_type $_FILES['Image5']['type'];
       
    $Image5_name $_FILES['Image5']['name'];
       
    $Image6      $_FILES['Image6']['tmp_name'];
       
    $Image6_type $_FILES['Image6']['type'];
       
    $Image6_name $_FILES['Image6']['name']; 
    then, would this work
    PHP Code:
       //add atttachments
       
    $mail->AddAttachment($Image1_name);
       
    $mail->AddAttachment($Image2_name);
       
    $mail->AddAttachment($Image3_name);
       
    $mail->AddAttachment($Image4_name);
       
    $mail->AddAttachment($Image5_name);
       
    $mail->AddAttachment($Image6_name); 
    or how would I do it?
    Thanks
    What gets output is
    AddAttachment1:sample1.gif
    From
    PHP Code:
      echo "AddAttachment1:".$Image1_name."<br>"
    but how do I get a /images/ASP_photos/ before it?
    "Oh, and Jenkins--apparently your mother died this morning."

  6. #6
    Resident Code Monkey Chris Corbyn's Avatar
    Join Date
    Nov 2005
    Location
    Melbourne, Australia
    Posts
    713
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by lukeurtnowski
    but how do I get a /images/ASP_photos/ before it?
    Concatenate the string using a dot ".". But why do you need to do that? tmp_name is where the file is.

    PHPMailer's memory usage on attachments isn't great. Especially if you're sending 6 you may risk hitting the 8MB limit even on smallish attachments.

    Take a look at these figures: http://www.swiftmailer.org/phpmailer/ (about 3/4 down the page)

    Swift would do it like this, and use at least 20% memory. PHPMailer seemed to hang lots when I used to use it.

    PHP Code:
    $mailer->addAttachment(file_get_contents($Image1), $image1_name$image1_type);
    $mailer->addAttachment(file_get_contents($Image2), $image2_name$image2_type);
    // repeat for each attachment 


Bookmarks

Posting Permissions

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