tags:

views:

29

answers:

2

Hi guys,

I have a php script set up to generate emails. Currently, they give the success message but don't actually send the email.

I just had a look in the php configuration settings file, and I noticed this:

[mail function]
; For Win32 only.
SMTP = localhost
smtp_port = 25

Is this where I change the SMTP to the address I need the emails to be relayed through?

Any help would be appreciated, thanks :)

A: 

Yes you can set the server that's going to be used to send mails via SMTP there (as the comment states, this is WIN32 only!). I however suggest you have a look at phpmailer, which eases your work with sending mails in php. It supports custom SMTP settings aswell.

halfdan
+1  A: 

When you're on Windows, PHP's mail function can use a SMTP server. (That is because Windows lacks Unix/Linux's centralized, standardized mailing functions.)

However, its possibilities are very limited: It supports neither authentication nor encryption - both things that most mail services require nowadays.

If you want to use an external SMTP server (like Google Mail's), an external mailing class like Swiftmailer that can connect to SMTP servers using SSL/TLS and authentication.

Otherwise,a lightweight mail server like Mercury can accept local E-Mail and "re-send" it through a proper SMTP server.

Pekka
Hi Pekka, Thanks for the reply. The thing is, I actually know the mail server I need to use. I have the address for it. I just wondered is this where I specify it? I tried it, and tested it but still no email.
TaraWalsh
@Tara see my updated answer. You're probably best off using Swiftmailer or PHPMailer
Pekka
Thanks Pekka, all sorted now :)
TaraWalsh