www.webdeveloper.com
Results 1 to 5 of 5

Thread: want to send email from text file.

  1. #1
    Join Date
    Dec 2006
    Posts
    115

    Question want to send email from text file.

    Hi all,

    I have a form which accepts emails and copy them in a text file line after line. Following is the content of the text file.

    *******************
    jack@yahoo.com
    rose@hotmail.com
    tina@msn.com
    *******************

    now I want to send email to all these contacts together by php.

    I need to know how will I retrive the contacts from text file and will send them bulk email with "bcc" so that one can't view another email.

    how is it possible please help me

    thanks in advance
    jack

  2. #2
    Join Date
    Jun 2006
    Location
    Down at the bottom of the garden
    Posts
    1,239
    Hello Jack

    Why use Bcc, why not just send unique mails to each user?

    PHP Code:
    <?php
    $addresses 
    file("emails.txt");

    $subject "My Subject";
    $message "My Message";

    foreach(
    $addresses as $address)
    {
        
    mail($address$subject$message);
        echo 
    "Sent message to ".$address."<br>";
    }
    ?>

  3. #3
    Join Date
    Dec 2006
    Posts
    115
    Wow

    Works fine but on some email service providers(eg. hotmail) itís going to Junk mail folder

    Any way to send emails to Inbox??


    Thanks in advance

    Jack


    Quote Originally Posted by MrCoder
    Hello Jack

    Why use Bcc, why not just send unique mails to each user?

    PHP Code:
    <?php
    $addresses 
    file("emails.txt");

    $subject "My Subject";
    $message "My Message";

    foreach(
    $addresses as $address)
    {
        
    mail($address$subject$message);
        echo 
    "Sent message to ".$address."<br>";
    }
    ?>

  4. #4
    Join Date
    May 2003
    Posts
    599
    The php mail function is stndard and is not what is making it go to junk mail. junk mail is usually the result of the message content, for example the presence of an opt-out mechanism is detected. Or a configuration on the server is not correct or some piece of header info is missing, or some services are still looking for reverse dns and will flag the message if not detected.
    We do precision guesswork

  5. #5
    Join Date
    Dec 2006
    Posts
    115
    so wat is the way to send emails to inbox?

    Quote Originally Posted by hastx
    The php mail function is stndard and is not what is making it go to junk mail. junk mail is usually the result of the message content, for example the presence of an opt-out mechanism is detected. Or a configuration on the server is not correct or some piece of header info is missing, or some services are still looking for reverse dns and will flag the message if not detected.

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