help to send anonymous email to hotmail

Discussion in 'PHP' started by darkmaster2008, Jan 1, 2010.

  1. #1
    Gentlemen my problem is as follows

    I have a php code to send anonymous mail send CUNADO it works perfectly for gmail yahoo and others
    but when I send this to a hotmail mail not even fails as span
    my question is should I add to the code so that messages correctly llguen to hotmail inbox
    Here is the code php

    
    link rel="stylesheet" type="text/css" href="style.css"> 
    <meta http-equiv="Content-Language" content="es"> 
    <form method="POST" action="anonimo.php"> 
    <p align="center"> 
    &nbsp;&nbsp;&nbsp;&nbsp; 
    Tu eMail: 
    <input type="text" name="email" size="20"><br> 
    Tu nombre: 
    <input type="text" name="nombre" size="20"><br> 
    Para (eMail): <input type="text" name="para" size="20"><br> 
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Asunto:&nbsp; 
    <input type="text" name="asunto" size="20"><br> 
    <br> 
    Mensaje<br> 
    <textarea rows="4" name="comentarios" cols="36"></textarea><br> 
    <br> 
    <input type="submit" value="Enviar" name="B1"> 
    <input type="reset" value="Borrar todo" name="B2"></p> 
    </form> 
    <? 
    $nombre = $_REQUEST["nombre"]; 
    $remitente = $_REQUEST["email"]; 
    $mensaje = $_REQUEST["comentarios"]; 
    $asunto = $_REQUEST["asunto"]; 
    $para = $_REQUEST["para"]; 
    mail("$para", $asunto, $mensaje, "From: $remitente $nombre") 
    ?> 
    
    PHP:
    many thanks in advance I expect an answer
     
    darkmaster2008, Jan 1, 2010 IP
  2. CodedCaffeine

    CodedCaffeine Peon

    Messages:
    130
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    0
    #2
    That made me laugh. xD

    You're going to need some more headers in the mail feature, something similar to:

    $nombre = $_REQUEST["nombre"]; 
    $remitente = $_REQUEST["email"]; 
    $mensaje = $_REQUEST["comentarios"]; 
    $asunto = $_REQUEST["asunto"]; 
    $para = $_REQUEST["para"];
    $headers = 'From: webmaster@example.com' . "\r\n" .
        'Reply-To: webmaster@example.com' . "\r\n" .
        'X-Mailer: PHP/' . phpversion();
    
    mail("$para", $asunto, $mensaje, $headers);
    Code (markup):
     
    CodedCaffeine, Jan 2, 2010 IP
  3. darkmaster2008

    darkmaster2008 Peon

    Messages:
    6
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    please correct me if I'm wrong this is what I do:

    replace this part of my code

    
    mail ($ to, $ subject, $ message, "From: $ sender $ name")
    
    PHP:
    these are the headers that you gave me

    
    $ headers = 'From: webmaster@example.com'. "\ r \ n".
        'Reply-To: webmaster@example.com'. "\ r \ n".
        'X-Mailer: PHP /'. phpversion ();
    mail ($ to, $ subject, $ message, $ headers);
    
    PHP:
    Is this right?
    I expect a prompt reply back friend CodedCaffeine
    thank you very much
     
    darkmaster2008, Jan 2, 2010 IP
  4. CodedCaffeine

    CodedCaffeine Peon

    Messages:
    130
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Yep. That's right. The only thing I'd change to it would be the email address that is replying back to you (The 'webmaster@example.com' emails)

    From:
    is the email that will be shown when receiving the message.

    Reply-To:
    is the email that will be used when replying to the message.

    Generally, keeping both the same will work.
     
    CodedCaffeine, Jan 2, 2010 IP
  5. darkmaster2008

    darkmaster2008 Peon

    Messages:
    6
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5
    hi new friend I've done some tests with the headers you gave me and I would say something
    with the code above that I could personalize the mail delivery address and the name of arrival in the inbox
    now comes as
    also to give the answer as
    and the inbox as webmaster
    as I do not have to be altering the direction the php code every time you want to put a different sender?
    thanks
    I hope your answer please
     
    darkmaster2008, Jan 2, 2010 IP
  6. CodedCaffeine

    CodedCaffeine Peon

    Messages:
    130
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    0
    #6

    This will work:
    $headers = 'From: "'.$nombre.'" <'.$remitente.'>' . "\r\n";
    $headers .= 'Reply-To: "'.$nombre.'" <'.$remitente.'>' . "\r\n";
    $headers .= 'Return-Path: <'.$remitente.'>' . "\r\n";
    $headers .= 'X-Mailer: PHP /'. phpversion () . "\r\n";
    $headers .= 'MIME-Version: 1.0' . "\r\n";
    $headers .= 'Content-Type: text/HTML; charset=UTF-8';
    
    mail ($ to, $ subject, $ message, $ headers);
    PHP:
     
    CodedCaffeine, Jan 2, 2010 IP
  7. darkmaster2008

    darkmaster2008 Peon

    Messages:
    6
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #7
    The full code would look like?

     
    <link rel="stylesheet" type="text/css" href="style.css"> 
    <meta http-equiv="Content-Language" content="es"> 
    <form method="POST" action="anonimo.php"> 
    <p align="center"> 
    Your eMail: 
    <input name="email" size="20"> <br> 
    Your name: 
    name="nombre" size="20"> <input <br> 
    To (eMail): <input name="para" size="20"> <br> 
    Subject: 
    name="asunto" size="20"> <input <br> 
    <br> 
    Message <br> 
    <textarea rows="4" name="comments" cols="36"> </ textarea> <br> 
    <br> 
    <input type="submit" value="Submit" name="B1"> 
    <input type="reset" value="Clear todo" name="B2"> </ p> 
    </ form> 
    <? 
    $ name = $ _REQUEST [ "name"]; 
    $ sender = $ _REQUEST [ "email"]; 
    $ message = $ _REQUEST [ "comment"]; 
    $ subject = $ _REQUEST [ "subject"]; 
    $ to = $ _REQUEST [ "for"]; 
    $ headers = 'From:'. $ name. ' "<'. $ sender. '>'. "\ r \ n"; 
    $ headers .= 'Reply-To: "'. $ name. '" <'. $ sender. '>'. "\ r \ n"; 
    $ headers .= 'Return-Path: <'. $ sender. '>'. "\ r \ n"; 
    $ headers .= 'X-Mailer: PHP /'. phpversion (). "\ r \ n"; 
    $ headers .= 'MIME-Version: 1.0'. "\ r \ n"; 
    headers .= 'Content-Type: text / html; charset = UTF-8'; 
    mail ($ to, $ subject, $ message, $ headers); 
    ?> 
    
    PHP:
    I hope your answer please thanks
     
    darkmaster2008, Jan 2, 2010 IP
  8. CodedCaffeine

    CodedCaffeine Peon

    Messages:
    130
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    0
    #8
    <link rel="stylesheet" type="text/css" href="style.css"> 
    <meta http-equiv="Content-Language" content="es"> 
    <form method="POST" action="anonimo.php"> 
    <p align="center"> 
    Your eMail: 
    <input name="email" size="20"> <br> 
    Your name: 
    name="nombre" size="20"> <input <br> 
    To (eMail): <input name="para" size="20"> <br> 
    Subject: 
    name="asunto" size="20"> <input <br> 
    <br> 
    Message <br> 
    <textarea rows="4" name="comments" cols="36"> </ textarea> <br> 
    <br> 
    <input type="submit" value="Submit" name="B1"> 
    <input type="reset" value="Clear todo" name="B2"> </ p> 
    </ form>
    
    <?php 
    $ name = $ _REQUEST["name"]; 
    $ sender = $ _REQUEST["email"]; 
    $ message = $ _REQUEST["comment"]; 
    $ subject = $ _REQUEST["subject"]; 
    $ to = $ _REQUEST["for"]; 
    $ headers = 'From:'. $name. ' "<'. $sender. '>'. "\ r \ n"; 
    $ headers .= 'Reply-To: "'. $name. '" <'. $sender. '>'. "\ r \ n"; 
    $ headers .= 'Return-Path: <'. $sender. '>'. "\ r \ n"; 
    $ headers .= 'X-Mailer: PHP /'. phpversion(). "\ r \ n"; 
    $ headers .= 'MIME-Version: 1.0'. "\ r \ n"; 
    headers .= 'Content-Type: text / html; charset = UTF-8'; 
    mail ($to, $subject, $message, $headers); 
    ?>
    PHP:
    That should work :)
     
    CodedCaffeine, Jan 2, 2010 IP
  9. darkmaster2008

    darkmaster2008 Peon

    Messages:
    6
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #9
    hello frend found a small error in the code this

     
    headers .= 'Content-Type: text / html; charset = UTF-8';
    
    PHP:
    thus correcting the

     
    $ headers .= 'Content-Type: text / html; charset = UTF-8';
    
    PHP:

    I am about to send proof of notice you have a moment as I was

    very thanks
     
    Last edited: Jan 2, 2010
    darkmaster2008, Jan 2, 2010 IP
  10. darkmaster2008

    darkmaster2008 Peon

    Messages:
    6
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #10
    hello friend did the tests and shipping of the new code and unfortunately still the same perfect send the message to gmail but still can not get messages to hotmail inbox anyway thank you very much your valuable support and interest in the subject learned a lot in parctica with you because this led to enter this type of code and knew little besides review some basic functionality of the php code

    I leave here the link of hosting the file where it is housed and from where I do the tests if you do your test shipments

    http://pes2009.hastlehosting.com.ve/anonimo.php

    anyway if you arrive later to find out some form or type that you can be modificion Agragar or making code for the hotmail messages reach your idea is welcome and watch out for possible new subject soul ANSWERS

    is that these filters are very well protected hotmail

    thank you very much

    att DarkMaster
     
    darkmaster2008, Jan 2, 2010 IP