I’m using PHP, and now i found that the php native mail() method is finally also the smtp.
Ok lets say i am using very simple:
mail("david@gmail.com","hello","hello");
If this code fails, can i say it is SMTP and/or connection to SMTP Server problem?
What i want to discover finally is:
- So can i say that, we are ONLY using
smtpfinally (to send) ? - Or, any other mail sending systems we can use (in PHP at least) ?
I’m asking this knowledge because:
- I want to confirm that, whenever we have problems in sending mails (by using flawless coding), so that is the problem about SMTP Server & its Configurations etc. Can i say that?
Note: Please, I do not have enough knowledge in mail systems. So maybe i need a brief explanation about major different mail systems (if there is something else then smtp).
Yes, we are only using SMTP to send email. In the world there is actualy no alternative today – absoultely most of mail servers use SMTP for sending mail.
Actually, it depends on what do you need exactly. For example, if you need to send email with your PHP script and you don’t want to use ‘mail()’and SMTP directly on your server, you could use web-mail.
I mean if you have any email account on gmail or yahoo or whatever email-system, you can send email with web interface of the mail service. So, you could use the same web interface in your PHP script to send email.
Sure, you have to code this way in PHP (it is not like just execute some PHP-function). And, sure, after you sent your email with web interface the mail server will send it forward finally using SMTP protocol.
UPDATED
Usually, SMTP server will send you an error message or an email with explanation what is wrong. If you have issues with mail sending, it could be not only SMTP related problems, but network configuration related issues or your hoster, or something else.
For example, many hosters blocks TCP port 25 (the port SMTP is working on). This is not an SMTP configuration issue, but hoster’s firewall configuration.
So… actually it all depends on the exactly situation.