I am using PHP Mailer to send invoices to my clients. Some clients have adressed the problem that my mails land in their spam folders (I cannot disprove it). I read several articles and posts here and tried to orient my settings according to How do you make sure email you send programmatically is not automatically marked as spam?.
Since there are a lot more suggestions, of which I am not sure about, I want to check on what I am currently deploying and what actually makes sense.
What I checked:
- I use mostly plain text, very less html (just
<p>
) and no css - The IP adress of the mail server matches the adress of my domain
- I am on no blacklist (looked it up on several pages referenced in high-voted posts here)
- I always send emails from the domain of my website, no other domain shows up in any parts of the mail (like reply to etc.)
What I did not check / What I'm not sure about:
- Authentication methods, such as SPF or DKIM. As a not advanced user concerning programming emails I do not know how to set these things up - is it still advisable/acceptable operating without?
- I only use my main-domain for sending my e-mails rather than an additional email domain. Some suggested to use this extra email domain in case I lose reputation. Is it recommended to use extra email domains for this?
- Is it possible to check if my mails actually land in the spam folder e.g. with the PHP Mailer or do I need third party email services (like "Mailgun")?
- I do not always have the full name for the
To
Field, is it still advisable to add the last name (without first name) to the email adress?
My PHP Mailer lines (do I use everything that is recommended?):
require_once('../PHPMailer/class.phpmailer.php');
iconv_set_encoding("internal_encoding", "UTF-8");
$mail = new PHPMailer();
$mail->CharSet = 'UTF-8';
$mail->isSMTP();
$mail->Host = 'xxx';
$mail->SMTPAuth = true;
$mail->Username = 'xxx';
$mail->Password = 'xxx';
$mail->SMTPSecure = 'tls';
$mail->Port = 25;
$mail->setFrom('xxx', 'Potatoe');
$mail->addAddress('xxx', 'AnotherPotatoe');
$mail->addReplyTo('xxx', 'xxx');
$mail->addCC('xxx');
$mail->addAttachment('/xxx/xxx.pdf');
$mail->isHTML(true);
$mail->Subject = 'xxx';
$mail->Body = 'xxx';
$mail->AltBody = 'xxx';