Send email works even if mail doesn't exist

Certified Senior Developer

Hello,

I have a problem in process model when trying to send email. I needed to implement functionality as follows: 

User needs to be on interface and enter email in textbox on which he wants to send email. After he clicks on the button email with document should be sent. User should then get information if email was sent or not on interface.

For this I am using a!startProcess function on interface to start process model to send email. I have configured output message with all nodes having activity chaining at the end of the process model. 

Message is returned when email is successfully sent, but when email that user enters does not exist I have a problem.

In many cases, process will break on send e-mail node if user enters email that does not exist. 

For instance I enter email ttestttttteee@gmail.com and process will break.

But, if I enter email ttestttttteee@gmail.comm

process model will continue and email will be sent. The problem is in email text after @ sign. Whatever I enter after @ sign, process will show that email was successfully sent.

What can I do if I want user to get notification if e-mail he entered does not exist?

Thanks in advance. 

  Discussion posts and replies are publicly visible

Parents
  • 0
    Certified Lead Developer

    Hi! This is a good question, and definitely something that Appian can help handle. To handle bad email inputs, you can create a new expression rule and use it to validate your users input prior to when they try to click the button to send the email.

    On this post in the forum, you can see that someone has provided a use of the regexmatch function in order to validate the email input. If you use this code in your new rule, you should be able to ensure that your user isn't allowed to send emails to bad email addresses.

    regexmatch(
      pattern: "^[A-Z0-9\'\+\&\%_-]+(\.{0,1}[A-Z0-9\'\+\&\%_-]+)*[@]{1}[A-Z0-9.-]*[A-Z0-9-]+[.]{1}[A-Z]{2,6}$",
      searchString: ri!email,
      regexFlags: "si"
    )

    If you need any help understanding what this function is doing, reading about regular expressions can help you get some background, but basically its just using a pre-determined pattern to dissect your given email string and see if it is valid.

    If you need help figuring out how to put this in an expression rule and use it to prevent a user from sending an email to a bad address, please just let me know and I'll be happy to show how you can do that!

  • 0
    Certified Senior Developer
    in reply to Nicole Walter

    I entered mentioned regex before I posted this question, but the problem is not in validation. Validation works, but I can't validate anything in email except @ sign and ".". Problem is in domain which I cannot validate because user can send emails to any domain. Thanks anyway! 

Reply Children