Skip to main content

DKIM and SPF for phpMailer

Comments

15 comments

  • cPanelMichael
    Hello, This is discussed on the following thread: DKIM in cPanel with PHPmailer clarification Thank you.
    0
  • googol8080
    Hello, This is discussed on the following thread: DKIM in cPanel with PHPmailer clarification Thank you.

    That thread did not answer my question (or not clear to me), I am using a shared hosting plan.
    0
  • Infopro
    That thread did not answer my question (or not clear to me), I am using a shared hosting plan.

    I think the answer is here: DKIM in cPanel with PHPmailer clarification do I need to add DKIM details to PHPMailer class? -- NO. If your mailer server is the same server as the DKIM details are setup on then you do not need to add any DKIM details to the PHPMailer class
    0
  • googol8080
    I think the answer is here: DKIM in cPanel with PHPmailer clarification

    The tech support here said that DKIM and SPF are already configured on my cPanel account, that means I do not need to add the DKIM details to PHPMailer right? If so, why does gmail users still saw a red question mark whenever I sent an email with my domain's email account?
    0
  • Infopro
    Correct. Your script does need to use an authenticated user though. Do you have the script configured properly to use an actual email account's credentials?
    0
  • googol8080
    I think I do, for reference here is the code I tried, I copied it from github/PHPMailer example:
    isSMTP(); $mail->SMTPDebug = 0; $mail->Debugoutput = 'html'; $mail->Host = "mail.mydomain.com"; $mail->Port = 587; $mail->SMTPSecure = 'tls'; $mail->SMTPAuth = true; $mail->Username = "my@domain.com[/EMAIL]"; $mail->Password = "correctpassword"; $mail->setFrom('my@domain.com[/EMAIL]', 'From domain'); $mail->addAddress('to@gmail.com[/EMAIL]', 'To other user'); $mail->Subject = "This is the subject."; $mail->Body = "This is a Message."; if (!$mail->send()) { echo "Error sending message"; } else { echo "Message sent!"; } ?>
    0
  • Infopro
    I'm unable to assist you with configuring your script properly but looking at the github page for it github.com/PHPMailer/PHPMailer I do find usage examples probably worth a closer look: github.com/PHPMailer/PHPMailer/tree/master/examples
    0
  • googol8080
    Thanks, I am quite confused right now. It seems my example above is correct. When I asked on stackoverflow they said DKIM, ugh, I do not know now, haha. Thank you for the response.
    0
  • Infopro
    Not sure how helpful, but have a peek at the comment at top of this script: github.com/PHPMailer/PHPMailer/blob/master/examples/DKIM.phps
    0
  • googol8080
    Already read that and the link at the comment, that is why I am confused, you and the tech support here said that I do not need to use DKIM to PHPMailer, but someone said that I might need to apply it.
    0
  • Infopro
    Have you asked for assistance there? For an example, issues are being responded to: github.com/PHPMailer/PHPMailer/issues/880
    0
  • googol8080
    Oh nice, I thought Pull Request! I didn't see the issue area, I will ask and will respond to your for updates thank you!
    0
  • googol8080
    Oh nice, I thought Pull Request! I didn't see the issue area, I will ask and will respond to your for updates thank you!

    Asked on github, no response. github.com/PHPMailer/PHPMailer/issues/891
    0
  • cPanelMichael
    Asked on github, no response. github.com/PHPMailer/PHPMailer/issues/891

    Hello, I recommend reaching out to your web hosting provider for additional assistance. They should be able to help answer any questions you have about the server configuration, and determine if other accounts on the same shared server can send email to Google from PHP scripts without issue. Thanks!
    0
  • googol8080
    Hello, I recommend reaching out to your web hosting provider for additional assistance. They should be able to help answer any questions you have about the server configuration, and determine if other accounts on the same shared server can send email to Google from PHP scripts without issue. Thanks!

    Thanks!
    0

Please sign in to leave a comment.