Keep Server Online
If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.
or
A donation makes a contribution towards the costs, the time and effort that's going in this site and building.
Thank You! Steffen
Your donations will help to keep this site alive and well, and continuing building binaries. Apache Lounge is not sponsored.
| |
|
Topic: php mail() and the 'require authentication' issue |
|
Author |
|
medad
Joined: 09 Apr 2006 Posts: 4
|
Posted: Mon 05 Mar '07 14:33 Post subject: php mail() and the 'require authentication' issue |
|
|
hello all
my ISP requires authentication, and I can't get mail() function to work properly.
is there a way I can make php act as a mail client other than using the mail() function?
thanks in advance
medad |
|
Back to top |
|
James Blond Moderator
Joined: 19 Jan 2006 Posts: 7371 Location: Germany, Next to Hamburg
|
Posted: Mon 05 Mar '07 16:51 Post subject: |
|
|
You can set your ISP smtp in the php.ini
What are you tring to do? |
|
Back to top |
|
medad
Joined: 09 Apr 2006 Posts: 4
|
Posted: Tue 06 Mar '07 14:04 Post subject: |
|
|
it's set alright, and my ISP is the notorious BT who use borrowed smtp servers, and hence require authentication.
I am trying to use VBulletin on my box and it's actually possible as it was working with the last ISP.
the current config makes 'require autentication' a must and therefore I can't set php to do the job.
I downloaded Sendmail for windows and it's running alright, but yet I can't get PHP to talk to it.
thanks in advance. |
|
Back to top |
|
pips
Joined: 03 May 2006 Posts: 65 Location: Manchester, UK
|
Posted: Tue 06 Mar '07 14:23 Post subject: |
|
|
we use some server software called David from Tobit Software Gmbh http://www.tobit.com - this acts as a full SMTP email server (amongst other stuff), all I do in my PHP script to send an email is use the following code:-
Code: | ini_set("SMTP", "172.20.0.2");
ini_set("smtp_port", "25");
mail("mail@recipient.co.uk","Subject","text of email","headers"); |
Obviously I have security measures in place on the POSTMAN.NLM module, which only allows emails from certain internal IP addresses, thus stopping external users from using it as a SPAM portal!
Although I haven't tried it (yet), I would imagine if you downloaded and installed Mercury (http://www.pmail.com/downloads.htm) then set that up to allow emails from a certain IP address, it will send them directly rather than use BT as the SMTP mail server?
Some of our customers still use BT as their ISP (against our advice too!!), and where possible, we avoid using the BT SMTP server, as it's a pain in the a**e trying to get them to accept that you actually own the domain - I had it recently when they wouldn't accept a customers domain because the postcode was 2 digits wrong - even though the company name, contact name, address, telephone all matched the whois search with their records!! Anyway, I'd better get off my soapbox now! lol.
Hope this helps.
Phil. |
|
Back to top |
|
medad
Joined: 09 Apr 2006 Posts: 4
|
Posted: Wed 07 Mar '07 2:41 Post subject: |
|
|
hi Phil
thanks so much for the info,
I will download the mercury server, but the thing is,,,
how do I set my php.ini file then?
do I tell it to use the localhost as smtp? |
|
Back to top |
|
James Blond Moderator
Joined: 19 Jan 2006 Posts: 7371 Location: Germany, Next to Hamburg
|
Posted: Wed 07 Mar '07 10:02 Post subject: |
|
|
in php.ini !
Code: |
[mail function]
SMTP = localhost
; For Win32 only.
sendmail_from = you@yourhost.tld
|
|
|
Back to top |
|
pips
Joined: 03 May 2006 Posts: 65 Location: Manchester, UK
|
Posted: Wed 07 Mar '07 10:43 Post subject: |
|
|
as James says you can set it in your php.ini file, but if you want to be able to send emails from different email addresses, then you can override these by including the following in the actual php page:-
Code: | ini_set("SMTP", "172.20.0.2");
ini_set("smtp_port", "25"); |
just replace the 172.20.0.2 with the ip address of the mail-server or localhost.
Phil. |
|
Back to top |
|
|
|
|
|
|