Meetings every second Tuesday
LAMP - SMTP Question.
Is it possible to use a differnet smtp server (not local to the box) when sending mail using mail()?
- Ubuntu
- php4.4
- apache2
|
|
Meetings every second Tuesday |
|
SearchNavigationUser login |
LAMP - SMTP Question.Is it possible to use a differnet smtp server (not local to the box) when sending mail using mail()?
|
Upcoming events2009 Conference - Call for speakers
PHP Quebec is pleased to announce the seventh edition of the PHP Quebec Conference. The Conference will take place in Montreal, Canada between March 4 and 6th, 2009. We are looking for speakers willing to share their expertise with Canadian and United States PHP professionals. The Conference features technical talks and Labs dedicated to advanced software development techniques with PHP5 and PHP6, XML, web services, databases, etc., project management where speakers and visitors will try to find solutions to actual business problems. Organizers will prioritize new and original topics in English or French. For more information, visit the website: PHP TopicsJob Search (PHP in Portland, Oregon)
|
Sure
the php.ini has settings for this...
[mail function] ; Setup for Windows systems
SMTP = smtp.my.isp.net
sendmail_from = me@myserver.com
even though it may be labeled for 'windows' systems, you can use it for a Linux such as Ubuntu Sitepoint has a good article on this
http://www.sitepoint.com/article/advanced-email-php
The Real Challenge is Relay Authentication
Every mail server has to protect itself from being used as a spam mail relay so you have to remember to handle this issue in your PHP coding effort. There are a couple of ways to do this depending upon how much control of the remote mail server configuration you have.
The easiest way is to just configure the mail server to allow relaying from your web server's IP address. This requires that you have configuration access to the mail server.
If you must use SMTP Authentication to relay through the remote mail server you have to have a valid user account on the mail server and you have to be able to send user/password along with the request. That'a pretty tricky scenario and it depends a lot on your target relay mail server. You have to code your own connection to the mail server (rather than just using the built-in mail function).
If you're trying to save time and you don't want to expose your web server SMTP service to the Internet there are other workarounds to secure the SMTP service on the web server so that outsiders can't use it. So many variables, so little time. I can't go into it all here.
Hope some of this helps.