Results 1 to 4 of 4

Thread: email not being received and no error message is returned.

  1. #1
    Join Date
    Jan 2006
    Posts
    170
    Thanks
    8
    Thanked 0 Times in 0 Posts

    Default email not being received and no error message is returned.

    I'm sending emails through my website and it works for most of the recipients. However, I've run into one (on hotmail) that doesn't receive it and no error message is received from the destination mail server (as it is if I send from my personal email).

    What I want to know is what I need to do to receive error messages if the emails are not delivered.

    Here's the code I'm using:

    PHP Code:
    chdir('../../Dealer');
    $myFile "InvitationTemplate.rtf";
    $myFile1 "DealersList.txt";
    $myFile2 "Dealer_Files/Invitation Letter.rtf";
    $fh1 fopen($myFile1'r') or die("can't open file $myFile1");
    while (!
    feof($fh1)) {
    $fh fopen($myFile'r') or die("can't open file $myFile");
    $fh2 fopen($myFile2'w') or die("can't open file $myFile2");
    $message1 fgets($fh1);
    $pos strpos($message1',');
    $name substr($message1,0,$pos);
    $email substr($message1,$pos+1);
    $email str_replace("\n"''$email);
        while(!
    feof($fh)) {
            
    $message fgets($fh);
            if (
    strpos($message'Dear') !== false){
            
    $message str_replace('Dear','Dear ' $name,$message);
            }
            
    fwrite($fh2,$message);
        }
        
    fclose($fh);
        
    fclose($fh2);
        
        
    //Insert email code here
    $files = array("Dealer_Files/Invitation Letter.rtf","Dealer_Files/Application Request.pdf","Dealer_Files/Dealer Contract.pdf");
    $types = array("rtf","pdf","pdf"); 
    // email fields: to, from, subject, and so on
    $to $email;
    $from "dealer_chair@ohiobuttons.org"
    $subject ="Dealer Information Package"
    $message "\n\nAttached please find your Dealer Package.\n\nThis email was generated automatically.\n\nIf you have any problems with this email or its attachments, please contact webmaster@ohiobuttons.org or\nsimply reply to this email.\n";
    $headers "From: $from";
     
    // boundary 
    $semi_rand md5(time()); 
    $mime_boundary "==Multipart_Boundary_x{$semi_rand}x"
     
    // headers for attachment 
    $headers .= "\nMIME-Version: 1.0\n" "Content-Type: multipart/mixed;\n" " boundary=\"{$mime_boundary}\""
     
    // multipart boundary 
    $message "This is a multi-part message in MIME format.\n\n" "--{$mime_boundary}\n" "Content-Type: text/plain; charset=\"iso-8859-1\"\n" "Content-Transfer-Encoding: 7bit\n\n" $message "\n\n"
    $message .= "--{$mime_boundary}\n";
     
    // preparing attachments
    for($x=0;$x<count($files);$x++){
        
    $file fopen($files[$x],"rb");
        
    $data fread($file,filesize($files[$x]));
        
    fclose($file);
        
    $data chunk_split(base64_encode($data));
        
    $attachment strpos($files[$x], '/');
        
    $attachment substr($files[$x],$attachment+1); 
        
    $message .= "Content-Type: {\"application/octet-stream\"};\n" " name=\"$attachment\"\n" 
        
    "Content-Disposition: attachment;\n" " filename=\"$attachment\"\n" "Content-Type: application/{$types[$x]};\n" .
        
    "Content-Transfer-Encoding: base64\n\n" $data "\n\n";
        
    $message .= "--{$mime_boundary}\n";
    }
     
    // send
    $ok mail($to$subject$message$headers); 
    if (
    $ok) { 
        echo 
    "<p>Email sent to $name at $to!</p>"
    } else { 
        echo 
    "<p>Email could not be sent to $name at $to!</p>"

    }
        
    fclose($fh1);
    ?> 
    Would appreciate any help/advice on this.

    Thanks.

  2. #2
    Join Date
    Mar 2010
    Location
    Florida
    Posts
    512
    Thanks
    9
    Thanked 61 Times in 59 Posts

    Default

    Any chance you can provide the email? If you dont want to display it publicly then PM me it.
    -DW [Deadweight]
    Resolving your thread: First Post: => EDIT => Lower right: => GO ADVANCED => Top Advance Editor drop down: => PREFIX:Resolved

  3. #3
    Join Date
    Jan 2006
    Posts
    170
    Thanks
    8
    Thanked 0 Times in 0 Posts

    Default

    Hi DW.

    Thanks for the response. I'm currently working with my server's tech support. If they can't solve the problem on their end, I'd be happy to PM you the email. I'll post what the outcome is.

    Thanks again,
    Jim

  4. #4
    Join Date
    Mar 2010
    Location
    Florida
    Posts
    512
    Thanks
    9
    Thanked 61 Times in 59 Posts

    Default

    Okay feel free to PM when ever.
    -DW [Deadweight]
    Resolving your thread: First Post: => EDIT => Lower right: => GO ADVANCED => Top Advance Editor drop down: => PREFIX:Resolved

Similar Threads

  1. Replies: 6
    Last Post: 12-24-2009, 06:15 AM
  2. Error Message in 3d spinning message
    By drgsb in forum Dynamic Drive scripts help
    Replies: 0
    Last Post: 05-24-2009, 06:36 AM
  3. Replies: 4
    Last Post: 04-06-2009, 05:30 AM
  4. Replies: 2
    Last Post: 05-28-2008, 04:16 AM
  5. Replies: 2
    Last Post: 11-10-2006, 05:22 PM

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
  •