The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Problem with default email account

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

  1. devashanti

    devashanti Registered

    Joined:
    Aug 10, 2011
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    1
    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 orders@clientdomain.com (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:

    from username@ip-184-168-83-94.ip.secureserver.net

    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 clientdomain.com not ip-184-168-83-94.ip.secureserver.net - 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 = 'myemail@gmail.com';
    $from = 'orders@clientdomain.com';
    $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)) {
    header("location:eek:rder_confirm.php?confirm_message_flag=order");
    //echo "<p>Message delivery success...</p>";
    }
    else {
    echo "<p>Message delivery failed...</p>";
    }
     
  2. mhm_jr

    mhm_jr Registered

    Joined:
    Aug 10, 2011
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    1
    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;

    to

    $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
Loading...

Share This Page