• Resolved matthart

    (@matthart)


    Wordpress: 5.7.3
    PHP: 7.3.27

    On the form’s notification settings, I only have the required fields filled. The from email field is empty, so it’s sending from the site admin email address.

    All the SMTP settings are filled on the form.
    Force from override: true
    Host: smtp.office365.com
    Encryption: SSL
    Port: 587
    Username and From Email Address are the same.
    Username and Password are correct.
    I don’t think it’s an SMTP issue because I’m able to send from that email via SMTP with nodemailer.

    Other issues I had:
    Debug SMTP doesn’t seem to do anything for me. Nothing in the console, nothing on the form. I’m using text confirmation type.
    Also, “test SMTP settings” doesn’t seem to test anything, it just updates the settings. I put in wrong values and it still updated them.

    A (potential?) request:
    Since I haven’t been able to get the plugin to work, I don’t know if it does this already, but I would like to have a reply-to field. Will it use the reply-to field from the notification settings along with the from email address from the smtp settings, or will you have to add a reply-to field setting if I want to be able to set that?

Viewing 15 replies - 1 through 15 (of 17 total)
  • Plugin Author Kevin Pirnie

    (@kevp75)

    Hi @matthart

    Do you have an existing SMTP plugin already installed and configured? Can you tell me which it is?

    If the “test SMTP settings” is not doing anything, there may be a javascript issue happening. It’s ajax that runs it.

    Setting the “Debug” enables the WordPress built-in Mailer debugger, which would then show the debug information when you post the form on the front-end of the site.

    Setting a reply-to field would simply add that as a normal “reply-to” to the email sent. Sort of like when you are configuring your email client, you can configure a reply-to that gets sent along with each email you send out.

    Would you be willing to send me WP Admin access, so I can take a look at your setup?

    Plugin Author Kevin Pirnie

    (@kevp75)

    @matthart I cannot help you without the answers to my questions mate.

    I will close this in a couple more days to give you a chance to respond

    Thread Starter matthart

    (@matthart)

    Sorry, it’s a business website, not personal, I’m just helping them with these forms, so I had to clear it with the relevant teams, and there were some modifications to our plan, so I didn’t know if we were going to use this method anymore anyway.

    I don’t have any other SMTP plugins installed.

    I don’t know why the test SMTP isn’t working either. I’m using the newest version of Chrome, I don’t have any js disabled. XMLHttpRequest is working. Ajax should definitely be fine.

    Is there any way to look at the debug info only using the online editor or without enabling debug on the live site? I tried a couple plugins, none could do what I wanted. I’ve never developed with wordpress before, I was just helping with these forms.

    I will email you about the admin access today.

    Plugin Author Kevin Pirnie

    (@kevp75)

    @matthart
    No problem

    You can enable normal WP debug on a live site without showing the errors. in wp-config.php:

    define( ‘WP_DEBUG’, true );
    define( ‘WP_DEBUG_DISPLAY’, false );
    define( ‘WP_DEBUG_LOG’, true );

    This will write the debug output to wp-content/debug.log

    As for debugging the SMTP, no real way to do it… though, you have me thinking of updating to give it a way to do it without displaying the output… I’ll research the WP mailer a bit more today…

    As for debugging the JS, I’m not sure of a way to do that without displaying it…

    Who’s the email provider?

    Thread Starter matthart

    (@matthart)

    Email provider is Outlook.

    Can I replace the wp-config on the server while people are editing and using the site or should I wait until after 5?

    Plugin Author Kevin Pirnie

    (@kevp75)

    Outlook… sorry, I see you posted that in the OP, along with:

    Username and From Email Address are the same.

    You can edit it while people are working on the site… just make sure everything is right with the lines before saving the file.

    Best bet would be to create a staging area… this way you can turn on the SMTP debug, and test the form without interruptions… There really is no way to debug this unless you see something in your debug.log

    Thread Starter matthart

    (@matthart)

    Even though I verified that Outlook through SMTP is working for us with javascript, I know Outlook causes issues with a lot of people with SMTP, so I tried with Gmail and it also didn’t have an effect. It’s still sending emails, just not through SMTP, regardless of setup. The issue seems to be with the plugin not overriding the default email sending. If I have a from email address in the gravity form notifications settings, it’ll send from that email. If I don’t, it sends from the site admin email.

    Plugin Author Kevin Pirnie

    (@kevp75)

    @matthart

    The only way you can verify if it’s using the SMTP or the default built-in WordPress mailer, is to turn on debug in the settings, and then submit a form.

    Thread Starter matthart

    (@matthart)

    Here’s what I got. Let me know if/when you want admin access or anything else you want me to do (like adding some echo statements). Our hosting provider doesn’t have an easy “add staging site”, so I’d rather not go through the trouble of doing it manually just for this unless we decide it’s absolutely necessary.

    [18-Oct-2021 16:35:42 UTC] PHP Notice: Undefined index: fieldId in /home/user/public_html/wp-content/plugins/smtp-settings-for-gravity-forms/work/inc/kp-gfsmtp-extend-common.php on line 82
    [18-Oct-2021 16:35:42 UTC] PHP Notice: Undefined index: value in /home/user/public_html/wp-content/plugins/smtp-settings-for-gravity-forms/work/inc/kp-gfsmtp-extend-common.php on line 84
    [18-Oct-2021 16:35:42 UTC] PHP Notice: Undefined index: operator in /home/user/public_html/wp-content/plugins/smtp-settings-for-gravity-forms/work/inc/kp-gfsmtp-extend-common.php on line 84
    [18-Oct-2021 16:35:42 UTC] PHP Warning: extract() expects parameter 1 to be array, object given in /home/user/public_html/wp-content/plugins/gravityforms/common.php on line 2391

    Plugin Author Kevin Pirnie

    (@kevp75)

    Thanks @matthart but i was actually talking about the SMPT Debug in the settings for the plugin.

    I can look into those you sent in, but they aren’t errors, and wouldn’t effect this.

    Thread Starter matthart

    (@matthart)

    I got those by turning on the debug settings in your plugin and submitting a form. I assumed they would help because they were the only lines in debug.log that came from your plugin. I’ll just email you about admin access and you can take a look yourself.

    Plugin Author Kevin Pirnie

    (@kevp75)

    @matthart
    This should be corrected in the newest version I just pushed up.

    I also added that reply-to field ??

    Thread Starter matthart

    (@matthart)

    I was excited to have it finally working and I appreciate you adding the reply-to field. I wish I didn’t have more bad news, but it’s not working. I had to deactivate the plugin for now because on every form submission, the website crashes and says there’s a critical wordpress error. That’s about where the bad news ends.

    The good news is that it might not be an issue with the plugin. I checked debug logs and I got
    [2021-10-20 01:37:03]: SMTP ERROR: Failed to connect to server: Connection refused (111)
    [2021-10-20 01:37:03]: SMTP connect() failed. https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting

    I looked at the supplied page and found that that error can be caused by our hosting provider having firewalls on the SMTP ports. I tried telnet to check if port 25 and 587 were open, and it said they were, so theoretically, it shouldn’t be that. Also, since the log says “Connection refused” and not “Could not connect” like on the phpmailer troubleshooting page, I don’t think it’s the port being closed, but something is getting in the way of connecting to the smtp servers. I did try with gmail as well, and got the same thing, so it’s more likely on our hosting provider’s side than outlook’s side.

    I tried to ssh into it to try manually connecting to the smtp server to see what would go wrong, but our hosting provider blocks ssh by default, so I’ll have to contact them to change that.

    I just found a really easy way to make a local copy of the wordpress site, so I will be trying that later tonight to see if your plugin works. If it does, then I’ll know for sure that it’s an issue with our hosting provider.

    I’ll keep this open until then. I really appreciate you trying to help solve a problem that might not have even existed in the first place lol

    Plugin Author Kevin Pirnie

    (@kevp75)

    =) @matthart

    Not sure if it didn’t exist mate, there were some issues anyways… even though they were related to GF updates, they still needed to be fixed ??

    Keep me posted

    Thread Starter matthart

    (@matthart)

    So I was able to make a local copy of the site and I tested your plugin and it worked perfectly. I also decided to triple-check it wasn’t your plugin by trying another SMTP plugin on our live site, and it got the same Connection Refused error. So it’s pretty much confirmed now that it’s our hosting provider, so I guess I’ll have to ask them about sending via SMTP, even though telnet said the ports were technically open.

    I appreciate your help until now, I know it’s been a long journey, and I’m glad you at least got something out of it (and I got my reply-to field).

    Anyway, I’ll be closing marking this as resolved now.

Viewing 15 replies - 1 through 15 (of 17 total)
  • The topic ‘SMTP settings filled, but still uses default email send settings’ is closed to new replies.