PHP auto email

Discussion in 'PHP' started by bobocheez, Dec 23, 2008.

  1. #1
    How are those auto emails sent that do not go into the junk folder and are not marked as dangerous.
    For instance when you signup for a site it sends you an email. Some sites it ends up in spam and marked dangerous, some go straight to your inbox without a problem.

    How do you get them to be like normal emails?
    The auto email does not have an "ID" of some sort, I looked that up with hotmail thats why it was spammed/marked as dangerous.
     
    bobocheez, Dec 23, 2008 IP
  2. www.hunthost.in

    www.hunthost.in Peon

    Messages:
    147
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Use this ->

    
    <?php
    
    $Name = "Da Duder"; //senders name
    $email = "email@adress.com"; //senders e-mail adress
    $recipient = "PersonWhoGetsIt@emailadress.com"; //recipient
    $mail_body = "The text for the mail..."; //mail body
    $subject = "Subject for reviever"; //subject
    $header = "From: ". $Name . " <" . $email . ">\r\n"; //optional headerfields
    
    ini_set('sendmail_from', 'me@domain.com'); //Suggested by "Some Guy"
    
    mail($recipient, $subject, $mail_body, $header); //mail command :)
    
    echo "Mail Sent";
    
    ?>
    
    
    PHP:
    Source: php.net/mail
     
    www.hunthost.in, Dec 23, 2008 IP
  3. planemaniac

    planemaniac Peon

    Messages:
    49
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #3
    I think the mail still gets marked as spam if the content of the auto email is spammy. Of course, it's very hard to hide the true identity of an e-mail, as it will always have the IP of the server it came from on it. The PHP mail() function is what you need.
     
    planemaniac, Dec 24, 2008 IP
  4. bobocheez

    bobocheez Active Member

    Messages:
    403
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    55
    #4
    Isn't the thing hunthost gave me? The PHP mail function?
     
    bobocheez, Dec 24, 2008 IP