SitePoint Sponsor

User Tag List

Results 1 to 5 of 5

Thread: php mail

  1. #1
    SitePoint Guru afridy's Avatar
    Join Date
    Mar 2007
    Posts
    966
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    php mail

    Hello,

    i am sending new account activation mail from activation@mysite.com.
    but the client's mail header shows the mail has come from : my-hosting-account-name@box780.bluehost.com

    i have also created an email account activation@mysite.com in cpanel

    what could be wrong ?


  2. #2
    Utopia, Inc. silver trophy
    ScallioXTX's Avatar
    Join Date
    Aug 2008
    Location
    The Netherlands
    Posts
    9,039
    Mentioned
    152 Post(s)
    Tagged
    2 Thread(s)
    What is the code that is sending the emails? Without code it's kind hard to determine what's wrong.
    Rémon - Hosting Advisor

    Minimal Bookmarks Tree
    My Google Chrome extension: browsing bookmarks made easy

  3. #3
    SitePoint Guru afridy's Avatar
    Join Date
    Mar 2007
    Posts
    966
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by ScallioXTX View Post
    What is the code that is sending the emails? Without code it's kind hard to determine what's wrong.
    Hai Scallioxtx,

    this is the header

    Code:
    	$headers = 'From: mysite.com' . "\r\n" .
    				'Reply-To: activation@mysite.com' . "\r\n" .
    					'X-Mailer: PHP/' . phpversion();
    	$headers .= 'MIME-Version: 1.0' . "\n";    
    	$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\n";
    	$headers .= 'Content-Transfer-Encoding: 8bit'. "\n";
    	$headers .= 'X-Priority: 3' . "\n";
    	$headers .= 'X-MSMail-Priority: Normal' . "\n";

  4. #4
    Utopia, Inc. silver trophy
    ScallioXTX's Avatar
    Join Date
    Aug 2008
    Location
    The Netherlands
    Posts
    9,039
    Mentioned
    152 Post(s)
    Tagged
    2 Thread(s)
    You should enter the email address in the FROM header as well:

    PHP Code:
    $headers 'From: mysite.com <activation@mysite.com>' "\r\n" .
                    
    'Reply-To: activation@mysite.com' "\r\n" .
                        
    'X-Mailer: PHP/' phpversion();
        
    $headers .= 'MIME-Version: 1.0' "\n";    
        
    $headers .= 'Content-type: text/html; charset=iso-8859-1' "\n";
        
    $headers .= 'Content-Transfer-Encoding: 8bit'"\n";
        
    $headers .= 'X-Priority: 3' "\n";
        
    $headers .= 'X-MSMail-Priority: Normal' "\n"
    No need to add X-Mailer BTW. It doesn't do anything and I'm pretty sure PHP adds it itself too if you omit it.
    Rémon - Hosting Advisor

    Minimal Bookmarks Tree
    My Google Chrome extension: browsing bookmarks made easy

  5. #5
    SitePoint Guru afridy's Avatar
    Join Date
    Mar 2007
    Posts
    966
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by ScallioXTX View Post
    You should enter the email address in the FROM header as well:

    PHP Code:
    $headers 'From: mysite.com <activation@mysite.com>' "\r\n" .
                    
    'Reply-To: activation@mysite.com' "\r\n" .
                        
    'X-Mailer: PHP/' phpversion();
        
    $headers .= 'MIME-Version: 1.0' "\n";    
        
    $headers .= 'Content-type: text/html; charset=iso-8859-1' "\n";
        
    $headers .= 'Content-Transfer-Encoding: 8bit'"\n";
        
    $headers .= 'X-Priority: 3' "\n";
        
    $headers .= 'X-MSMail-Priority: Normal' "\n"
    No need to add X-Mailer BTW. It doesn't do anything and I'm pretty sure PHP adds it itself too if you omit it.
    Thanks so much for correcting the header. works charm!!!


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •