I have a email smtp server with my ISP. This is the info of my email sever to use.

Email Address : megahertza@iprimus.com.au
Username : megahertza
Password : *********
SMTP Server : smtp.iprimus.com.au

How do i setup my php.ini to allow my localhost testing server to send email.

    The answer may disappoint you:

    PHP does not natively support authenticated SMTP servers. If your ISP requires SMTP authentication (most do & should), you cannot use their server to send mail.

    What can you do? Simply use a premade class/script that allows you to send mail to authenticated SMTP servers. Here's a couple of suggestions:

    • PHPMailer class (This one I've used; it's nice, has examples, and more features you can shake a stick at!)
    • XPertMailer (Haven't used this personally, but was mentioned in a user comment on the man page for [man]mail[/man])

      It works just fine below are the settings for a Windows with Apache and my ISP also requires authentication but my mail send just fine with my local server. I changed it to keep the spam bots and other bots from harvesting emails

      [mail function]
      ; For Win32 only.
      SMTP = mail.example.com/ /put the same thing you use in your local mail client
      smtp_port = 25
      
      ; For Win32 only.
      sendmail_from = me@example.com//just uncomment the ; and put your e-mail addy
      
      ; For Unix only.  You may supply arguments as well (default: "sendmail -t -i").
      ;sendmail_path = "C:\Program Files\xampp\sendmail\sendmail.exe -t"

      If I were you I would edit your post to not allow bots to harvest you e-mail address!!! After you edit your php.ini RESTART your Apache and then try sending an e-mail to yourself, it should work, but after you edit you file if you will do a phpinfo in the second table you should see the Proper Values for SMTP and sendmail from, if you do not then you might have edited the wrong php.ini (don't edit the php.ini-dist)

        Houdini wrote:

        my ISP also requires authentication but my mail send just fine with my local server

        If it works just fine, then your ISP can't require authentication to send mail, as PHP doesn't authenticate...

        EDIT: All I know is, my ISP truly requires SMTP authentication, and mail() wouldn't work for me as such.

          Thanks bradgrafelman, i download phpmailer. i didn't bother editing mu php.ini, i just coppied the the class file into my own includes folder where i just (include 'includes/class.phpmailer.php'😉 saves from changing the ini of remote hosts. it works fine, was able to send a email to my isp email account and a gmail account.

            If that is true then how do you explain this at this link is a gif of my settings clearly showing my ISP does require authentication and an email that I sent using my own localhost and just the parameters that I gave in my post except using my own isp information and my email address. Photo of my settings and an actual email And here the code that created the email that you see in the picture

            .<?php 
            $to = "steve@portedmods.astahost.com";
            $subject = "This is a test e-mail with PHP!";
            $message = "Theis is a test e-mail using the setting with the php.ini and it seems to show that all things are"
            ."happening the way they are supposed to hapeen! So this is the end of this silly message and the test.";
            mail($to,$subject,$message);
            Echo "E-mail sentto $to.";
             ?> 

              How do I explain it? Well... not sure. Maybe their server only allows relaying on their SMTP server from within certain IP subnets (i.e. the ones their DHCP server dishes out to clients).

              In your screenshot, you actually showed that you do NOT actually authenticate to your SMTP server. The bubble that's checked says use the auth info for the incomming server, not outgoing. So what Outlook actually does is logs onto your incomming mail server, and then sends any mail it needs to on the outgoing server (without logging in again on the outgoing server).

              Also, if you read the man page for [man]mail[/man], you'll see users talking about various classes/methods they had to use due to the fact that their SMTP server requires authentication.

                And If I'm not wrong there are differents methods of authentification too.
                So may be some are more easy than other to get working ?

                  If its authenticated, wheres the password. The smtp must be authenticated by ISP client IP logging

                    Megahertza wrote:

                    If its authenticated, wheres the password. The smtp must be authenticated by ISP client IP logging

                    That's why I didn't understand how he could be using mail() with an authenticated SMTP server, unless "authenticated" means something other than a username and password sent to the SMTP server.

                      Maybe this is why,
                      e-mail authentication
                      techweb

                      The verification that an e-mail message has been sent by the domain name in the From field.Called "domain spoofing," spammers falsify the From address in their messages in order not to be identified. SPF Classic, Sender ID and DomainKeys are authentication methods that are expected to proliferate. They all rely on DNS records, either to obtain sending mail server addresses or public keys for decrypting a digital signature. See Sender ID, DomainKeys and SPF

                      It just looks to see that the domain is an authentic domain name, there is nothing about passwords. My e-mail is being sent from an authentic domain mostly my own ISP. A valid domain has nothing to do with a password just is it a valid domain and if so then it will send the mail. Like I said I have no problems sending mail. All my ISP's have required email, but until recently (the past two years) have I used PHP mail and have been using the same ISP.

                      You might be getting authorization and authentication confused, I don't know all I know is that it works provided you have the right string for you SMTP server and didn't mispell your email address (which I did,and it would not send the mail, until I corrected it).

                        Write a Reply...