-1

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 (or pointed to the right way)?

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

also, using PHP 7.4

user655355
  • 164
  • 11

2 Answers2

1

I use this code in my project with PHPMailer:

require_once('./phpmailer/PHPMailer.php');
require_once('./phpmailer/Exception.php');
require_once('./phpmailer/OAuth.php');
require_once('./phpmailer/SMTP.php');

$email = new PHPMailer;
$email->Host = 'YOURSMTPDOMAIN';
$email->SMTPAuth = true;
$email->Username = 'YOUREMAILDOMAIN';
$email->Password = 'YOURPASSWORDDOMAIN';
$email->SMTPSecure = 'ssl';
$email->Port = 465;
$email->SetFrom("YOUREMAILDOMAINFROM", "NAME");
$email->addAddress('EMAILOFCLIENT');
$email->addBCC("ANOTHERRMAIL", "NAME"); //IF YOU NEED
$email->Subject = 'SUBJECT';
$email->Body = 'BODYMAIL';
$email->AddAttachment('LINK', 'NAME.pdf');//IF YOU NEED
$email->send();
Simone Rossaini
  • 8,115
  • 1
  • 13
  • 34
0

If you do not want to use google smtp you can try using Mailgun. Link to get started on Mailgun -> https://www.mailgun.com/blog/sending-email-using-the-mailgun-php-api/

Else if you want to set up your own SMTP server read this article https://help.fluidreview.com/hc/en-us/articles/115002141813-How-to-Set-Up-your-SMTP-Server

  • @NolanO There are multiple options you can use depending on the OS, but these aren't recommended for Production use. Here is a reference for setting it up locally https://mailtrap.io/blog/setup-smtp-server/ It is recommended to use a service like Mailgun or Amazon SES – Vijayaraghavan Sundararaman Jun 10 '21 at 07:37