Showing results for 
Show  only  | Search instead for 
Did you mean: 

Cpanel Default E-mail

Hello. I'm currently attempting to send an e-mail using a simple php contact form on my website. The form works and I receive the e-mail, but when I receive the e-mail, it says the e-mail is from   which is my default cpanel e-mail. How do I change it to where it shows it is from my domain? Here is the php I am using


// Email Submit
$name = @trim(stripslashes($_POST['name']));
$email = @trim(stripslashes($_POST['email']));
$subject = @trim(stripslashes($_POST['subject']));
$message = @trim(stripslashes($_POST['message']));
$email_from = $_POST["from address here"];
$email_to = 'to address here'; 
$message = 'Name: ' . $name . "\n\n" . 'Email: ' . $email . "\n\n" . 'Subject: ' . $subject . "\n\n" . 'Message: ' . $message;
$success = @mail($email_to, "[The Sauce] ".$subject, $message);
$noreply = @mail($email_from, "[Thank you]", "Thank you for contacting us. We will be in touch soon!");


Helper VI
Helper VI

Re: Cpanel Default E-mail

@jwat1537 in your code, you have to pick up the default email address from the server.

You can change this line:

$email_from = $_POST["from address here"];

And make it your own email address, like this:

$email_from = "";


Hope it helps!

If you find my replies helpful, give me a like or kudo 🙂
And if I solved your issue, mark it as solution 😄

Re: Cpanel Default E-mail

Thank you for the reply. Unfortunately, this method did not work. Is there a setting in cpanel I may be missing? I've always used free contact form services, but I'm wanting to get rid of any watermarks for this particular site, so this contact form php stuff is all new to me.