Community Forums
Connect with us on LinkedIn
+ Reply to Thread
Results 1 to 3 of 3
  1. #1
    Registered User
    Join Date
    Jan 2005
    Posts
    4

    Default Enable SMTP Authentication for PHP Mail

    Hi,

    Previously users had to use SMTP Authentication in their code.
    i.e. following fields

    from:
    host:
    username:
    password:

    ----------------------------------
    I think after update 11.28

    SMTP authentication is enabled and I've checked that I cannot send email via any email client without using SMTP authentication. I've also checked it via telnet and it confirms it.

    But, if following code is used in a PHP file to send email it sends it. Even if the from: address / domain does not exist on the server.

    PHP Code:

    <?
        $to 
    "xxxxxxx@gmail.com";
        
    $from 'anyone@fakedomain.com';
        
    $subject "Mail Subject";    

        
    $message 'This is a test message';

        
    $headers "MIME-Version: 1.0\r\n";
        
    $headers .= "Content-type: text/html; charset=windows-1253, UTF-8\r\n";
        
    $headers .= 'From: '.$from;
                
        if (
    mail($to$subject$message$headers))
            {
                echo 
    "Email Sent : "$to;
            }    
        else
            {
                echo 
    "Error Sending Email : "$to;
            }

    ?>
    --
    I also check the eximmainlog and it appears that the from: address being used to send these emails is the main user account.
    I want to revert it back, as it was earlier that no one can send email without using SMTP authentication in the code.

    Your help is highly appreciated.

    --
    Waqar

  2. #2
    Registered User
    Join Date
    Jan 2005
    Posts
    4

    Default Re: Enable SMTP Authentication for PHP Mail

    No one encountered above issue ?

    --
    Waqar

  3. #3
    Member Indianets's Avatar
    Join Date
    Jun 2008
    Posts
    54
    cPanel/Enkompass Access Level

    Root Administrator

    Default Re: Enable SMTP Authentication for PHP Mail

    Hello,

    Do you have "SMTP TWEAK" disabled in your WHM?

    Try enabling that and check once. Also, if you are using CSF you would like to set SMTP_ALLOWLOCAL = "0" instead.

    Vijay

Similar Threads & Tags
Similar threads

  1. SMTP AUTH (Mail Authentication)
    By crazyaboutlinux in forum E-mail Discussions
    Replies: 23
    Last Post: 04-20-2010, 02:31 PM
  2. Send Email From PHP Using SMTP Authentication (Guide)
    By WhmSonic in forum cPanel and WHM Discussions
    Replies: 4
    Last Post: 10-23-2008, 10:43 AM
  3. Enable SMTP authentication
    By hari_anj in forum cPanel and WHM Discussions
    Replies: 4
    Last Post: 05-09-2006, 10:33 AM
  4. CPANEL SMTP Authentication - Strange 'from' mail
    By coralbridge in forum cPanel and WHM Discussions
    Replies: 0
    Last Post: 03-15-2005, 03:54 AM
  5. How to enable Exim Secure Password Authentication
    By No-State in forum cPanel and WHM Discussions
    Replies: 1
    Last Post: 08-05-2004, 04:55 AM
Linkedin       Facebook       Twitter       RSS       Flickr       YouTube