Hey, I am fairly new to running a server and I just wondered what is better to use within your scripts and such, if a script has the option for SMTP and PHP to send mail which is better to use? What are the benefits of each?
I have better feeling with SMTP option. Sometimes, PHP mail will lead your emails to junk box, meanwhile SMTP is not.
Better to use a trusted SMTP like Google's server. It will almost ensure that your email won't be spam filtered unless the content is bad.
if you can configure and use SMTp but otherwise, PHP is fine as well and you dont need no info usually with it.
Oh cool thanks guys, just one question though, is there any security issue with using SMTP as you are using a username and password?
Nope there shouldn't be any security issues since nobody really sees your username / password but the script itself.
using php is the easiest option but SMTP will ensure better delivery of your mails. I use google apps for all my domains so use google's SMTP servers but it can be logged in only using SSL (TLS) so there should be SSL in your server. (and xpertmailer plugin (xpertmailer.com) is the best option if you are using wordpress blogs to send mail thru google apps). if you are really concerned with your mails ending in spam folder you need to configure SPF records in your DNS hosting. _
SMTP is best, get a google apps account (free) and use their servers. You will need OpenSSL installed on your server in order to pass the username and password encrypted though.