Thread: Need help

Results 1 to 3 of 3
  1. #1
    dawid17's Avatar
    Join Date
    Oct 2012
    Gender
    male
    Posts
    75
    Reputation
    10
    Thanks
    8

    Need help

    Code:
    <?php
    
    if (isset($_POST['submit'])) {
        $name = $_POST['name'];
        $email = $_POST['email'];
        $message = $_POST['message'];
        
        $mailTo = "MYMAIL@hotmail.com";
        $headers = "From: ".$email;
        $txt = "You have received an e-mail from ".$email.".\n\n".$name."\n\n".message;
        
        mail($mailTo, $name, $txt);
        header("Location: mailsend.php");
    }


    How can I make this email to appear on the top instead of my servers email address?
    The $headers doesnt seem to work?

    whenever I change the code to mail($mailTo, $name, $txt, $headers); I do not receive any email at all.
    Last edited by dawid17; 01-05-2019 at 05:01 PM.

  2. #2
    Develon's Avatar
    Join Date
    Jan 2019
    Gender
    male
    Posts
    1
    Reputation
    10
    Thanks
    0
    Quote Originally Posted by dawid17 View Post
    Code:
    <?php
    
    if (isset($_POST['submit'])) {
        $name = $_POST['name'];
        $email = $_POST['email'];
        $message = $_POST['message'];
        
        $mailTo = "MYMAIL@hotmail.com";
        $headers = "From: ".$email;
        $txt = "You have received an e-mail from ".$email.".\n\n".$name."\n\n".message;
        
        mail($mailTo, $name, $txt);
        header("Location: mailsend.php");
    }


    How can I make this email to appear on the top instead of my servers email address?
    The $headers doesnt seem to work?

    whenever I change the code to mail($mailTo, $name, $txt, $headers); I do not receive any email at all.
    Mail does have a 5th parameter that you can add. I think you can force the mail from address, like I have done below. But, it possibly could be how your mail server is setup that is causing the issue. You can also pass an array to the 4th parameter btw.

    Code:
    <?php
    
    if (isset($_POST['submit'])) {
        $name = $_POST['name'];
        $email = $_POST['email'];
        $message = $_POST['message'];
        
        $mailTo = "MYMAIL@hotmail.com";
        $headers = array(
            'From' => $email,
            'Reply-To' => $email
        );
        $params = "-f ".$email;
        $txt = "You have received an e-mail from ".$email.".\n\n".$name."\n\n".message;
        
        mail($mailTo, $name, $txt, $headers, $params);
        header("Location: mailsend.php");
    }

  3. #3
    Silent's Avatar
    Join Date
    Jan 2015
    Gender
    male
    Location
    Melbourne, Australia
    Posts
    5,071
    Reputation
    2172
    Thanks
    8,475
    My Mood
    Bitchy
    Quote Originally Posted by Develon View Post
    Mail does have a 5th parameter that you can add. I think you can force the mail from address, like I have done below. But, it possibly could be how your mail server is setup that is causing the issue. You can also pass an array to the 4th parameter btw.

    Code:
    <?php
    
    if (isset($_POST['submit'])) {
        $name = $_POST['name'];
        $email = $_POST['email'];
        $message = $_POST['message'];
        
        $mailTo = "MYMAIL@hotmail.com";
        $headers = array(
            'From' => $email,
            'Reply-To' => $email
        );
        $params = "-f ".$email;
        $txt = "You have received an e-mail from ".$email.".\n\n".$name."\n\n".message;
        
        mail($mailTo, $name, $txt, $headers, $params);
        header("Location: mailsend.php");
    }
    This is a bad idea, and you will be marked as spam instantly. If you want to send an email from your gmail account, send email through googles SMTP server. I think I got a simple SMTP script somewhere on my HDD that i made ages ago.

    here - https://pastebin.com/38WWSYv3

    You may need to fix encoding stuff, but that shouldn't be hard.


    - - - Updated - - -

    nevermind that was my raw mail object parser...

    use this - https://pastebin.com/6mPfQL8y
    Click Here to visit the official MPGH wiki! Keep up with the latest news and information on games and MPGH! To check out pages dedicated to games, see the links below!











    dd/mm/yyyy
    Member - 31/01/2015
    Premium - 12/09/2016
    Call of Duty minion - 05/11/2016 - 05/11/2019
    BattleOn minion - 28/02/2017 - 05/11/2019
    Battlefield minion - 30/05/2017 - 05/11/2019
    Other Semi-Popular First Person Shooter Hacks minion - 21/09/2017 - 17/09/2019
    Publicist - 07/11/2017 - 02/08/2018
    Cock Sucker - 01/12/2017 - Unknown
    Minion+ - 06/03/2018 - 05/11/2019
    Fortnite minion - 08/05/2018 - 05/11/2019
    Head Publicist - 08/10/2018 - 10/01/2020
    Developer Team - 26/10/2019 - 10/01/2020
    Former Staff - 10/01/2020



  4. The Following User Says Thank You to Silent For This Useful Post:

    dawid17 (01-17-2019)

Similar Threads

  1. [Help Request] Need Help
    By shane11 in forum CrossFire Help
    Replies: 49
    Last Post: 05-03-2011, 04:29 AM
  2. [Help Request] Need help finding a Vindictus injector
    By VpChris in forum Vindictus Help
    Replies: 2
    Last Post: 05-01-2011, 10:51 PM
  3. [Help Request] need help with mod
    By .:MUS1CFR34K:. in forum Call of Duty Modern Warfare 2 GSC Modding Help/Discussion
    Replies: 4
    Last Post: 05-01-2011, 12:40 PM
  4. [Help Request] I need help~~!!!!
    By c834606877 in forum Alliance of Valiant Arms (AVA) Help
    Replies: 1
    Last Post: 05-01-2011, 01:12 AM
  5. [Help Request] need help with modding
    By BayBee Alyn in forum Combat Arms Help
    Replies: 0
    Last Post: 04-27-2011, 09:06 PM