Support » Plugin: Postman SMTP Mailer/Email Log » "A valid address is required" issue with "Contact Form Builder" plugin

  • Resolved monolus

    (@monolus)


    Hi,

    I think I have an issue with emails generated by another plugin “Contact Form Builder”. This plugin is supposed to be able to send the information to one or more email address provided in the form settings…

    When I fill the form and send it however, postman shows this status in the related log: “A valid address is required.” Based on the log content of failed emails (Many thanks to postman for keeping and showing them easily like a charm!) I kinda guess I know what it is going on…

    I think the issue is that when I put one email address to receive the email, the email generator creates the “To” email parameter as:
    “email@server.com,”
    notice the last character is a Comma!

    even with more than one email address this Comma appears always at the end! So my guess is that postman gets the “To” parameter, split it into 2 email address, first one is correct, second one is empty and it returns an error.

    Although I know the issue is originally is coming from another plugin, I still think postman should not fail in this situation, it should ignore empty email addresses!

    Something like this before doing final validation would probably solve the issue, replacing all unwanted comma and spaces:
    $test = “, ,email1@server1.com , , ,email2@server2.com , , “;
    $new_test = preg_replace(“/^[, ]+|[, ]+$/”, “”, preg_replace(“/[, ]+/”, “,”, $test));
    echo $new_test;
    // returns: email1@server1.com,email2@server2.com

    For now, I’m just wondering should I hack the “Contact Form Builder” and fix the issue in their code (an get screwed up with their next update), or can I rely on postman for fixing the issue, since I see you are pretty fast with fixing the issues!

    You’re plugin is very useful and easy to use, and if I can get this fix done, I will give it 5 star for being awesome! 🙂

    https://wordpress.org/plugins/postman-smtp/

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Jason Hendriks

    (@jasonhendriks)

    Hi there! Thanks for using the plugin 🙂

    I still think postman should not fail in this situation, it should ignore empty email addresses!

    I agree. This behaviour is not right:

    235 2.0.0 OK
    MAIL FROM:<test@hendriks.ca>
    250 2.1.0 Ok
    RCPT TO:<test@hendriks.ca>
    250 2.1.0 Ok
    RCPT TO:<>
    501 5.1.7 Bad sender address syntax

    Your fix was too complex, I went with

    if (! empty ( $recipient )) {
    	...
    }

    😉

    Thanks for the bug report! Fixed in v1.6.7a.

    Sure, Thank you very much for fixing it! 🙂

    Voted 5 Star, marking this as resolved! 🙂

    Plugin Author Jason Hendriks

    (@jasonhendriks)

    Thank-you!

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘"A valid address is required" issue with "Contact Form Builder" plugin’ is closed to new replies.