The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

SOLVED DKIM and SPF for phpMailer

Discussion in 'E-mail Discussions' started by googol8080, Nov 27, 2016.

Tags:
  1. googol8080

    googol8080 Active Member

    Joined:
    Sep 28, 2016
    Messages:
    38
    Likes Received:
    2
    Trophy Points:
    8
    Location:
    Philippines
    cPanel Access Level:
    Website Owner
    Good day! How to find DKIM and SPF? I need to use that for phpMailer.
     
  2. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    37,064
    Likes Received:
    1,287
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
  3. googol8080

    googol8080 Active Member

    Joined:
    Sep 28, 2016
    Messages:
    38
    Likes Received:
    2
    Trophy Points:
    8
    Location:
    Philippines
    cPanel Access Level:
    Website Owner
    That thread did not answer my question (or not clear to me), I am using a shared hosting plan.
     
  4. Infopro

    Infopro cPanel Sr. Product Evangelist
    Staff Member

    Joined:
    May 20, 2003
    Messages:
    15,618
    Likes Received:
    296
    Trophy Points:
    433
    Location:
    Pennsylvania
    cPanel Access Level:
    Root Administrator
    Twitter:
    I think the answer is here:
    DKIM in cPanel with PHPmailer clarification
     
  5. googol8080

    googol8080 Active Member

    Joined:
    Sep 28, 2016
    Messages:
    38
    Likes Received:
    2
    Trophy Points:
    8
    Location:
    Philippines
    cPanel Access Level:
    Website Owner
    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?
     
  6. Infopro

    Infopro cPanel Sr. Product Evangelist
    Staff Member

    Joined:
    May 20, 2003
    Messages:
    15,618
    Likes Received:
    296
    Trophy Points:
    433
    Location:
    Pennsylvania
    cPanel Access Level:
    Root Administrator
    Twitter:
    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?
     
  7. googol8080

    googol8080 Active Member

    Joined:
    Sep 28, 2016
    Messages:
    38
    Likes Received:
    2
    Trophy Points:
    8
    Location:
    Philippines
    cPanel Access Level:
    Website Owner
    I think I do, for reference here is the code I tried, I copied it from github/PHPMailer example:
    Code:
    [B]<?php
    require 'PHPMailer-master/PHPMailerAutoload.php';
    
    $mail = new PHPMailer;
    
    $mail->isSMTP();
    $mail->SMTPDebug = 0;
    $mail->Debugoutput = 'html';
    $mail->Host = "mail.mydomain.com";
    $mail->Port = 587;
    $mail->SMTPSecure = 'tls';
    $mail->SMTPAuth = true;
    $mail->Username = "[EMAIL]my@domain.com[/EMAIL]";
    $mail->Password = "correctpassword";
    $mail->setFrom('[EMAIL]my@domain.com[/EMAIL]', 'From domain');
    $mail->addAddress('[EMAIL]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!";
    }
    ?>[/B]
    
     
  8. Infopro

    Infopro cPanel Sr. Product Evangelist
    Staff Member

    Joined:
    May 20, 2003
    Messages:
    15,618
    Likes Received:
    296
    Trophy Points:
    433
    Location:
    Pennsylvania
    cPanel Access Level:
    Root Administrator
    Twitter:
    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
     
  9. googol8080

    googol8080 Active Member

    Joined:
    Sep 28, 2016
    Messages:
    38
    Likes Received:
    2
    Trophy Points:
    8
    Location:
    Philippines
    cPanel Access Level:
    Website Owner
    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.
     
  10. Infopro

    Infopro cPanel Sr. Product Evangelist
    Staff Member

    Joined:
    May 20, 2003
    Messages:
    15,618
    Likes Received:
    296
    Trophy Points:
    433
    Location:
    Pennsylvania
    cPanel Access Level:
    Root Administrator
    Twitter:
    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
     
  11. googol8080

    googol8080 Active Member

    Joined:
    Sep 28, 2016
    Messages:
    38
    Likes Received:
    2
    Trophy Points:
    8
    Location:
    Philippines
    cPanel Access Level:
    Website Owner
    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.
     
  12. Infopro

    Infopro cPanel Sr. Product Evangelist
    Staff Member

    Joined:
    May 20, 2003
    Messages:
    15,618
    Likes Received:
    296
    Trophy Points:
    433
    Location:
    Pennsylvania
    cPanel Access Level:
    Root Administrator
    Twitter:
    Have you asked for assistance there? For an example, issues are being responded to:
    github.com/PHPMailer/PHPMailer/issues/880
     
  13. googol8080

    googol8080 Active Member

    Joined:
    Sep 28, 2016
    Messages:
    38
    Likes Received:
    2
    Trophy Points:
    8
    Location:
    Philippines
    cPanel Access Level:
    Website Owner
    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!
     
    Infopro likes this.
  14. googol8080

    googol8080 Active Member

    Joined:
    Sep 28, 2016
    Messages:
    38
    Likes Received:
    2
    Trophy Points:
    8
    Location:
    Philippines
    cPanel Access Level:
    Website Owner
    Asked on github, no response. github.com/PHPMailer/PHPMailer/issues/891
     
    #14 googol8080, Dec 5, 2016
    Last edited by a moderator: Dec 5, 2016
  15. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    37,064
    Likes Received:
    1,287
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    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!
     
  16. googol8080

    googol8080 Active Member

    Joined:
    Sep 28, 2016
    Messages:
    38
    Likes Received:
    2
    Trophy Points:
    8
    Location:
    Philippines
    cPanel Access Level:
    Website Owner
    Thanks!
     
    cPanelMichael likes this.
Loading...

Share This Page