By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
448,584 Members | 1,065 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 448,584 IT Pros & Developers. It's quick & easy.

remote SMTP server

P: n/a
Hi, I'm trying to setup PHP so it will use a remote SMTP server.
I'm going to sound like a newbie but how? I know you need to alter
php.ini, change SMTP from localhost to the SMTP server and the address
to the correct one but I wondered about passwords? Outlook Express
needs a password so how would I do it.
Unless anyone has any other suggestions/tutorials. Oh and just so you
know my port 25 is blocked by ISP, I think that limits my choices.

Ah forgot to mention, I managed to send a test email from my home
machine to another account using Xmail server but I can't get it to
work from a PHP script.

Thanks in advance,
Jul 17 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a

"Andy Turner" <an**********@btopenworld.com> wrote in message
news:8d**************************@posting.google.c om...
Hi, I'm trying to setup PHP so it will use a remote SMTP server.
I'm going to sound like a newbie but how? I know you need to alter
php.ini, change SMTP from localhost to the SMTP server and the address
to the correct one but I wondered about passwords? Outlook Express
needs a password so how would I do it.
Unless anyone has any other suggestions/tutorials. Oh and just so you
know my port 25 is blocked by ISP, I think that limits my choices.

Ah forgot to mention, I managed to send a test email from my home
machine to another account using Xmail server but I can't get it to
work from a PHP script.

Thanks in advance,


I've not done what you want to do however Outlook Express wants a password
for your POP3 settings (ie, to read/get your email). SMTP does not need a
username/password though some ISPs have managed to implement POP3 before
SMTP as a workaround for this (roughly meaning that the password you used to
get your email gets you temporary access to the SMTP server). Typically
though ISPs just check that you are on their network to get access to the
SMTP server to reduce the potential from non-customers relaying junk email
through their servers.

If you managed to send a test email from your home machine, you should
provide php.ini the same SMTP settings that you gave to xmail and then
try...

If that doesn't work, then I *believe* (I'm not definite) that you could
create your own SMTP sending function from within PHP. It is a standard
that the mail traffic agent (that handles email in/out of a server) listens
for email on port 25 - If you only want to send email (ie not
listen/receive), you could in theory use any port (thus use sockets in PHP)
to send an email - Thus you could in theory send using your local port 50 if
you wanted, but have your script communicate with remote port 25 on the
machine receiveing the email.

I'd suggest you join the sendmail newsgroup and bounce a few technical
questions at them if you plan on following my last suggested option.
Jul 17 '05 #2

P: n/a
an**********@btopenworld.com (Andy Turner) wrote in message
news:<8d**************************@posting.google. com>...

I'm trying to setup PHP so it will use a remote SMTP server.
Get yourself a copy of phpMailer:

http://phpmailer.sourceforge.net/
I'm going to sound like a newbie but how? I know you need to alter
php.ini


With phpMailer, there's no need to modify anything, as you will not
be using (and, hence, needing) mail() function nor imap_*() functions.

Cheers,
NC
Jul 17 '05 #3

P: n/a
KAH
"Randell D." <yo**************************@yahoo.com> wrote in
news:qX*********************@news1.calgary.shaw.ca :
I've not done what you want to do however Outlook Express wants a
password for your POP3 settings (ie, to read/get your email). SMTP
does not need a username/password though some ISPs have managed to
implement POP3 before SMTP as a workaround for this (roughly meaning
that the password you used to get your email gets you temporary access
to the SMTP server). Typically though ISPs just check that you are on
their network to get access to the SMTP server to reduce the potential
from non-customers relaying junk email through their servers.


If your ISP uses POP3 auth to give you SMTP access, change ISP immediately.
There is an SMTP service extension detailing SMTP authentication [1], which
all sane mail admins should use. This is the best solution if you can't be
sure of having all users coming from a specific network.

I don't think the mail() function has support for this, although I guess
sendmail might have and that you just have to give it the right arguments.
See the sendmail docs for that.

KAH
[1]: http://ftp.isi.edu/in-notes/rfc2554.txt
Jul 17 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.