close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Have you ever dealt with DKIM verification on email with PHPMailer?

Thread began 1/10/2023 1:36 pm by lr_leal239405 | Last modified 1/11/2023 2:19 pm by Ray Borduin | 461 views | 9 replies |

lr_leal239405

Have you ever dealt with DKIM verification on email with PHPMailer?

Have you ever dealt with DKIM verification on email with PHPMailer? If so, I need to implement on my php page but not sure how to do it after looking online. Let me know if it's something you've done before. Thanks.

Sign in to reply to this post

Ray BorduinWebAssist

I usually just use Authenticated SMTP email which would use the server's DKIM that is already set up.

Sign in to reply to this post
Did this help? Tips are appreciated...

lr_leal239405

It's for an Auto Reply with no real acct named autoreply@. So DKIM authentication is working on emails sent directly from email. I did set it up on DNS records some time ago. However, I saw online an example somebody gave that was added to the PHPMailer code that looked like this. I was thinking it's probably something you've used in the past.

$mail->DKIM_domain = ‘mywebsite.com’;
$mail->DKIM_private = dirname(__FILE__).’/key.private’; // Make sure to protect the key from being publicly accessible!
$mail->DKIM_selector = ‘selector1-mywebsite-com._domainkey.mywebsite.onmicrosoft.com’;
$mail->DKIM_passphrase = "";
$mail->DKIM_identity = 'noreply@mywebsite.com';

Sign in to reply to this post

Ray BorduinWebAssist

You can add it manually to the webassist code as long as you know the values to add.

The syntax is:

$WA_Emal->Mailer->DKIM_domain = ‘mywebsite.com’;
$WA_Emal->Mailer->DKIM_private = dirname(__FILE__).’/key.private’; // Make sure to protect the key from being publicly accessible!
$WA_Emal->Mailer->DKIM_selector = ‘selector1-mywebsite-com._domainkey.mywebsite.onmicrosoft.com’;
$WA_Emal->Mailer->DKIM_passphrase = "";
$WA_Emal->Mailer->DKIM_identity = 'noreply@mywebsite.com';
Sign in to reply to this post
Did this help? Tips are appreciated...

lr_leal239405

The Authenticated SMTP is already on. However, people get it in Spam folder, or Never receive it. Probably cause it's filtered out as Spam by their servers. So Authenticating with DKIM is another step to prevent this.

Sign in to reply to this post

Ray BorduinWebAssist

Authenticated SMTP should be adding DKIM automatically as long as you have the DNS records in place. Have you tried using: https://www.mail-tester.com/

You can send them an email from your system and they can tell you what is wrong and how to fix it if you are getting spam blocked.

Sign in to reply to this post
Did this help? Tips are appreciated...

lr_leal239405

I'm not sure I understand it all. However, I did manage to get the DKIM Signature to appear (correctly). I am not sure whether it needed isSMTP() but I added that line. It still says dkim=fail (signature syntax error), but maybe they're not going to clients' spam. I'm still trying to resolve that. But, now I'm more worried about the PHP Mail function I used for other auto emails sent. Maybe they are all going to clients' spam folders so many are never been read. Do you think it's a bad idea to use PHP Mail function? It's usually for small reminders to clients, not any bulk emails.

(I did try a different tester but not the one you suggested yet)

Sign in to reply to this post

Ray BorduinWebAssist

PHPMailer function is pretty much an industry standard. It isn't the problem. Your DNS settings, Reverse DNS settings, SPF Record, and DKIM settings may be issues, but that has nothing to do with php mailer. I'd suggest using the service I recommended above, they not only point out issues, bu they also give detailed instructions on how to fix them.

Sign in to reply to this post
Did this help? Tips are appreciated...

lr_leal239405

Thanks for the advise. I'll try it out. But I was asking about the PHP mail() type (vs. phpmailer). The syntax looks something like the below.

I'm worried about having to change from that to using phpmailer instead.

$from = "noreply@mywebsite.com";
$to = "$OrderEmail";

$subject = 'blahblah';

$headers = 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
$headers .= 'From: '. $from ."\r\n".
'Reply-To: '.$from."\r\n" .
'CC: somebody@somewebsite.com'."\r\n" .
'BCC: somebody@somewebsite.com."\r\n" .
'X-Mailer: PHP/' . phpversion();
$message = '<html><body>';

(mail($to, $subject, $message, $headers));

etc.

Sign in to reply to this post

Ray BorduinWebAssist

If you use type="mail" in php mailer, that is the code it writes for you, but it makes it easier to add attachments, DKIM, html and plain text versions, and others. There is no difference other than php mailer does it better.

Sign in to reply to this post
Did this help? Tips are appreciated...
loading

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...