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

mail() on linux to use other smtp server

P: n/a
hi all

i have written a php site that uses the mail() on windows and i had to
state in the php.ini file which smtp server to use.

have now migrated this site to a redhat 9 server, but i still want the
emails to be sent via the smtp server i stated earlier.

this may infact be a sendmail question, im not sure, (perhaps changing
sendmail_path in php.ini) but has anyone managed to send email via
mail() in php, on a linux box, that uses an external smtp server?

cheers
evan
Jul 17 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Hello,

on 02/09/2005 11:03 PM ehendrikd said the following:
hi all

i have written a php site that uses the mail() on windows and i had to
state in the php.ini file which smtp server to use.

have now migrated this site to a redhat 9 server, but i still want the
emails to be sent via the smtp server i stated earlier.
Why? You do not need necessarily to relay the messages in a SMTP server.
Sendmail can send the message for you directly to the recipient SMTP server.

this may infact be a sendmail question, im not sure, (perhaps changing
sendmail_path in php.ini) but has anyone managed to send email via
mail() in php, on a linux box, that uses an external smtp server?


No, I suppose you can configure sendmail to relay its messages to an
intermediate SMTP server if you really have to but that is not something
that you can configure from the sendmail command line arguments in php.ini .

If you really have to relay the messages to a SMTP server, you may want
to try this class that comes with a wrapper function named smtp_mail()
that works exactly like the mail function but lets you configure a SMTP
server to relay your messages.

http://www.phpclasses.org/mimemessage

You also need this:

http://www.phpclasses.org/smtpclass

--

Regards,
Manuel Lemos

PHP Classes - Free ready to use OOP components written in PHP
http://www.phpclasses.org/

PHP Reviews - Reviews of PHP books and other products
http://www.phpclasses.org/reviews/

Metastorage - Data object relational mapping layer generator
http://www.meta-language.net/metastorage.html
Jul 17 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.