cancel
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 jwaters1537@a2plcpnl0699.prod.iad2.secureserver.net   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

 

<?php
// 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!");
?>

 

2 REPLIES 2
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 = "your@address.com";

 

Hope it helps!

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

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.