Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!

Problem with default email account

Discussion in 'E-mail Discussion' started by devashanti, Aug 10, 2011.

  1. devashanti

    devashanti Registered

    Aug 10, 2011
    Likes Received:
    Trophy Points:
    I'm using php mail() function to send a confirmation email after inserting data into a database from a form submit. My code is correctly passing the variable values for the email including from: value of (not actual value but used as example the actual email address is one set up for my client through cpanel on his domain). I get the emails and everything is fine except the sent from email address.

    I have a virtual dedicated server with GoDaddy and when the recipient receives the email the from email addressed has been changed to:


    This is my server's ip address with GoDaddy and the name of their server. Of course I do not want to expose my client or his customers to GoDaddy's server name and ipaddress and the domain's cpanel username. They should see an email address coming from my client's domain; and specificly the one I used in my program code.

    GoDaddy claims this is a cPanel setting and that I need to change the default email address in the cpanel for the client's domain. The cPanel documentation states I can't do this and it states that no email addresses can be sent from this default email address which basically is the catch all for emails sent to invalid email addresses at the domain. Email Accounts Email Account

    When I view the Default Address Maintenance screen inside cpanel for my client's domain I see that it is set for not - so I have no idea where this email address is coming from and why the email is not being sent through the email address specified in my code...

    I'm fairly new with GoDaddy and in the past I hosted my client's as a reseller through other host providers with the same linux/cpanel server setup (I was on a shared server not a virtual dedicated server like I am now with GoDaddy) and never encountered this problem before. Any ideas? GoDaddy said I had to contact cPanel about the problem. I subitted a ticket with cPanel but never got a response and just before the ticket was submitted I got a message that my license was through GoDaddy so my ticket would be placed in a low priority status unless it went through them. I need to get this issue resolved to get payment from my client. PLEASE can someone tell me what is going on here...

    ********** my email order code ****************
    $to = '';
    $from = '';
    $subject = 'Online Order Submitted';
    $body = 'Order Details:<br/>Customer: ' . $f_name . ' ' . $l_name .
    '<br/>Phone: ' . $phone .
    '<br/> Cell: ' . $cell_phone .
    '<br/> Product Category = ' . $category .
    '<br/> Product Type = ' . $product_type .
    '<br/> Quantity = ' . $quantity .
    '<br/> Product Description = ' . $product_description .
    '<br/> Customer Comments: ' . $order_comments .
    '<br/> Order Submitted on: ' . $ts;
    $headers = 'Content-type: text/html; charset=iso-8859-1\r\n';
    $headers .= 'From: '.$from;
    //$headers = $from;
    //echo "<p>headers = $headers </p>";
    //echo "<p>to = $to, from = $from, body = $body, headers = $headers </p>";

    if (mail($to, $subject, $body, $headers)) {
    //echo "<p>Message delivery success...</p>";
    else {
    echo "<p>Message delivery failed...</p>";
  2. mhm_jr

    mhm_jr Registered

    Aug 10, 2011
    Likes Received:
    Trophy Points:
    I think the problem here is one of your header variables, the one setting From. I took your script, copied it to my own VPS and changed your 'to' to my own gmail account address, and your 'from' to a nonexisting email address on a valid domain on the VPS. I also changed:

    $headers .= 'From: '.$from;


    $headers = "From: $from";

    This test sent the email from the address I specified for 'from'. It also works on a valid account and valid domain for the 'from' variable. When I leave that header variable as you have it, the test works in that I receive the email, but fails in that it is sent from the server's $cpanel_user@$servers_hostname that the script was run under.
    #2 mhm_jr, Aug 10, 2011
    Last edited: Aug 10, 2011

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice