Jump to content

Where to Get Started When using PHP Mail()?

Guest
Go to solution Solved by Eigenvektor,

This might help in regards to PHP mail():

https://stackoverflow.com/a/977798

 

Do you just want to be able to send email or also receive it? In either case you probably want to go through an actual mail server so your mails are delivered properly and not immediately classified as spam.

 

You could set up your own mail server, but that might be more work/maintenance than you'd like. Here's a tutorial in can recommend. This is for Debian, but should work for pretty much any Linux  based distro (Commands to install software and some paths might be different).

I am Mostly confused where to get started to sending confirmation Emails?

 

 

I have everything setup ready to send emails (just not the mailing part, like making codes, user tracking etc)

 

Where can I get Started?

 

Something that may effect everything, Want to Host Everything myself (meaning no Google SMTP)

 

 

also, using PHP 7.4

Link to comment
Share on other sites

Link to post
Share on other sites

This might help in regards to PHP mail():

https://stackoverflow.com/a/977798

 

Do you just want to be able to send email or also receive it? In either case you probably want to go through an actual mail server so your mails are delivered properly and not immediately classified as spam.

 

You could set up your own mail server, but that might be more work/maintenance than you'd like. Here's a tutorial in can recommend. This is for Debian, but should work for pretty much any Linux  based distro (Commands to install software and some paths might be different).

Remember to either quote or @mention others, so they are notified of your reply

Link to comment
Share on other sites

Link to post
Share on other sites

11 minutes ago, Eigenvektor said:

This might help in regards to PHP mail():

https://stackoverflow.com/a/977798

 

Do you just want to be able to send email or also receive it? In either case you probably want to go through an actual mail server so your mails are delivered properly and not immediately classified as spam.

 

You could set up your own mail server, but that might be more work/maintenance than you'd like. Here's a tutorial in can recommend. This is for Debian, but should work for pretty much any Linux  based distro (Commands to install software and some paths might be different).

my question was worded very badly, only send email, and host the server myself

Link to comment
Share on other sites

Link to post
Share on other sites

If you mean hosting a mail server at home, on your home internet connection, you won't be able to. 

 

There are free mail servers available so you can set one up, but majority of email servers out there will instantly reject emails sent my your mail server to them, because your email server won't meet a minimum of requirements which are very hard to meet by regular home users. 

 

For example, you need to have Reverse DNS configured for your IP, and your home IP is most likely dynamic (the ISP may change it as needed) .. reverse IP basically means if someone types ping 1.2.3.4  (your ip)  , the reply should be  something like   pinging  mailserver.nolanrulesroblox.com  (1.2.3.4)  -  that mailserver.nolanrulesroblox.com is the subdomain you configured for your mail server  .. a submain that must be also configured as MX entry for your domain

 

Then you have to deal with domainkeys and the other entries that must be set on the domain so that your emails will be accepted by other mail servers (they're some entries you have to set so that email servers will say ah yes, the owner of this domain wants the server on  mailserver. xxx .com to be a mail server, and that mail server is allowed to send mails from that domain " ... )

 

In addition to this, most ISPs automatically add the IP classes they allocate to home users to some soft ban lists, which are monitored and used by mail servers ... basically the idea is whatever IP classes are in those lists, those aren't trusted, they're home users, which may have viruses or whatever installed on their computers, and spamming people. 

 

You would most likely need a business internet account, a fixed IP, in order to set up an email server at home. 

 

What you can do is rent a dedicated server, or buy a shared hosting account ... on a dedicated server you can set up a mail server, and on a shared hosting account, the company will have a mail server set up and you can get a username and password to send emails (they'll have limits on how many mails you can send and whatnot, but will work for you)

 

Another option you may have is to subscribe and pay for a service like sendgrid.com , sendinblue, pepipost, and others... pepipost has a page on their site, so it may be a bit biased but anyway ... : https://www.pepipost.com/blog/best-sendgrid-alternatives/

 

These are often used by companies to send newsletters  or stuff that's (mostly) one way (outgoing) only ... confirmation, registration, forgot password, 2 factor authentification ... you pay a certain amount for the number of emails sent. 

So instead of having the email server yourself, you just connect from php to their email servers and send the email. 

 

 

Link to comment
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×