Reputation: 127
I am trying to send email using PHPMailer class with SMTP details, My email server is hosted on other server. In this case do need postfix or sendmail service on web server to send emails though my email server is different?
e.g.
My domain is abc.com and my email is hosted on other server as abcmail.com and I am using SMTP authentication details of abcmail.com to send emails on abc.com by using PHPMail class.
But when I stop postfix service on abc.com mails stops working and when I restart postfix mails gets started again?
So is it mandatory to have postfix / sendmail service running on webserver to send emails though I use SMTP authentication details of some other email server?
Upvotes: 1
Views: 1887
Reputation: 37770
No. If you're sending via a remote SMTP host, you don't need a local mail server.
This is one of the reasons for PHPMailer's popularity - it's very common for Windows servers (unlike Linux servers) not to have a local mail server configured by default, so you need to be able to send to remote SMTP hosts directly, which isn't possible with a stock PHP config, so you need something like PHPMailer.
It sounds like you have a broken config, so I suggest you enable SMTPDebug = 2
so you can see what's going on in the SMTP conversation - e.g. to confirm that it's connecting to the correct server.
Upvotes: 1