Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Php Email

Status
Not open for further replies.

adam560

Programmer
Sep 10, 2006
14
AU
Hey,

Our company hosts our website on a server owned by an external company. We do our mass email sendouts via another external company.

In a website I created I've been using the php mail function to send emails. However, this means that the emails are being sent through the server of the wrong company.

If I set the website up to send through our smtp server, as shown below:


will that solve the problem? It doesn't matter if our web server is sending one email to our email server, as long as it is then distributed through the smtp server from there.

If not, how should I do this?

Any help would be greatly appreciated,

Adam
 
i've not read your reference but what you describe seems correct. although the web server does not send an email to the smtp server. you either point your mail() function at a local smtp server (if you are using windows) or a pc running postfix or sendmail or equivalent (if you are using linux). you change the pointer in the php.ini file.

if neither are an option for you, grab a copy of php_mailer from sourceforge and use its built in smtp class. this does not need "installation", it's just a set of php classes. in fact, this is probably the easiest of all routes.
 
Thanks for that. Just a follow on question:

As I understand it, if you use the mail function without specificying an smtp server it sends from the computer where your website is hosted. Is this correct or does it send from the computer that you used to run the page?

Cheers,

Adam
 
on windows machines the default smtp server is localhost (i.e. the box that is running the current script)
on linux the default sendmail path is
Code:
sendmail -t -i
(the path is relative to the box running the actual script)

you do not specify a server within the mail function itself.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top