Help - complete novice trying to send emails from localhost
Moderator: General Moderators
Help - complete novice trying to send emails from localhost
Please can anyone help before I walk away from php?
I am trying to test sending an email from a simple form however I am having no success as I recieve the following error messge;
Warning: mail() [function.mail]: Failed to connect to mailserver at "localhost" port 25, verify your "SMTP" and "smtp_port" setting in php.ini or use ini_set() in C:\wamp\www\experiment\CONTACT_FORM_RESPONSE.php on line 40
I have tried to amend the php.ini file but I am not too confident that I have done it correctly.
Please could someone tell me in plain english what I lines I need to change in the php.ini file?
Thanks
dapa
I am trying to test sending an email from a simple form however I am having no success as I recieve the following error messge;
Warning: mail() [function.mail]: Failed to connect to mailserver at "localhost" port 25, verify your "SMTP" and "smtp_port" setting in php.ini or use ini_set() in C:\wamp\www\experiment\CONTACT_FORM_RESPONSE.php on line 40
I have tried to amend the php.ini file but I am not too confident that I have done it correctly.
Please could someone tell me in plain english what I lines I need to change in the php.ini file?
Thanks
dapa
- RobertGonzalez
- Site Administrator
- Posts: 14293
- Joined: Tue Sep 09, 2003 6:04 pm
- Location: Fremont, CA, USA
change this section in your php.ini
you'll need to make sure your smtp server will accept mail from your web server (w/o a log in), or else you're going to need to step up to a different mail solution like swift or something.
Code: Select all
[mail function]
; For Win32 only.
SMTP = mail.yoursmtpserver.com
smtp_port = 25- Chris Corbyn
- Breakbeat Nuttzer
- Posts: 13098
- Joined: Wed Mar 24, 2004 7:57 am
- Location: Melbourne, Australia
What ISP are you with? Your ISP will usually give you an outgoing mail server. The one you'd place in your email client like outlook or thunderbird. It's usually one of (but not limited to):
outgoing.<yourisp>.tld
smtp.<yourisp>.tld
mail.<yourisp>.tld
For example, gmail uses:
smtp.gmail.com
If you have access to a terminal window which can run the DIG command (a linux box will usally suffice) then you can do this:
Say my email was phillip@tiddlywinks.info
I could get the SMTP for it (usually) by running:
dig MX tiddlywinks.info
That returns DNS records for the mail exchangers for tiddlywinks.info
That MX server may only receive incoming mail though so don't count on it, but hopefully you get where I'm coming from.
outgoing.<yourisp>.tld
smtp.<yourisp>.tld
mail.<yourisp>.tld
For example, gmail uses:
smtp.gmail.com
If you have access to a terminal window which can run the DIG command (a linux box will usally suffice) then you can do this:
Say my email was phillip@tiddlywinks.info
I could get the SMTP for it (usually) by running:
dig MX tiddlywinks.info
That returns DNS records for the mail exchangers for tiddlywinks.info
That MX server may only receive incoming mail though so don't count on it, but hopefully you get where I'm coming from.