Gossamer Forum
Home : General : Internet Technologies :

Mail() Function

Quote Reply
Mail() Function
This question may have already been answered on this forum, I've looked through the PHP posts on the "mail()" function and I haven't found my answer. If anyone can direct me to an answer, or answer my question yourself, I'd be very grateful.

Here's my problem. I want to start a mailing list for my website, I have been using a database and PHP to do this. In my PHP.ini file, I've set the SMTP server to my ISP email account "shawmail".

PHP.ini

>>

[mail function]
; For Win32 only.
SMTP = shawmail

; For Win32 only.
sendmail_from = Present Truth Admin

<<

My coding for this mail function looks like this:

mail("$eAddress", "$eSubject", "$eMessage", "From: Present Truth Admin\nReply-To: presenttruth@shaw.ca");

All email addresses in my database that are on the shawmail server; eg. joshuarivard@shaw.ca, and presenttruth@shaw.ca; both receive the emails that I send out. However, all the accounts in the database that are @hotmail.com, @yahoo.com, or any other server do not receive the email. Can anyone tell me why, and a way I can fix this problem?
Quote Reply
Re: [JoFrRi] Mail() Function In reply to
Welp, that will probably be because the 'shawmail' address is not a valid one Wink

You need something like;

localhost
smtp.yourdomain.com
smtp.yourISP.cm
yourisp.com

etc. The only reason 'localhost' works, is because that makes the server look at itself. Its the same kind of stuff for setting up the address of a MySQL server.

Hope that makes sense :)

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] Mail() Function In reply to
Hrm, "shawmail" is all I use in Outlook Express to connect to that server and it works just fine? Is this because it's a pop3 server and not an SMTP server? This is strange because on a phpBB forum I've installed, I've set the SMTP server to "shawmail" aswell and it seems to work okay.
Quote Reply
Re: [JoFrRi] Mail() Function In reply to
I could understand it working if that's what you've set the name of your host to, but when I read you also use it on your pc then that doesn't make sense. You can't have your pc and server both recognize "shawmail".

What actually is that?...is it a host name as in localhost?
Quote Reply
Re: [JoFrRi] Mail() Function In reply to
Try changing it to 'localhost'. If that doesn't work, you'll need to ask whoever is hosting your website to give you access to an SMTP server. 'shawmail' will only deliver mail to it's own network, hence the problems with @yahoo.com and @aol.com.

Cheers,

Alex
--
Gossamer Threads Inc.
Quote Reply
Re: [JoFrRi] Mail() Function In reply to
"shawmail" is my ISP's incoming POP3 server, and my ISP's outgoing SMTP server. My site is hosted on my personal webserver (apache).

I've done some more testing and the mailing list is now working for yahoo addresses. The hotmail results have still yet to turn out positive. When I sent an email straight from my @shaw.ca account to my @hotmail.com account, it took probably around an hour for it to receive it. This could also be what's happening with my mailing results, I'm not sure.

Thanks for all your guys' interest in my problem though. Smile

Last edited by:

JoFrRi: Apr 8, 2003, 12:19 PM
Quote Reply
Re: [JoFrRi] Mail() Function In reply to
Oh, I just remembered that I heard that hotmail now rejects mail delivered from cable/dsl IP's to minimize spam (like that really helps much). That might be why.

Adrian