web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Customer experience | Sales, Customer Insights,...
Suggested Answer

Validate Email Address on Email Marketing feature

(0) ShareShare
ReportReport
Posted on by 80

Hi all,

On Marketing Emails, when user design and go-live email, there is any tool or script that we can validate email address/ form name with the specific rules? Without validate, email can be sent out with misstype, fake or scam email address to a huge segment. User can type in without any restriction.

pastedimage1656410964944v1.png

I have the same question (0)
  • Suggested answer
    Community Member Profile Picture
    on at

    Hi Duy Bao VN1,

    According to your description, I use JS script to implement verification email address.

    21.png

    Below is the JS code:

    function validateEmail(execuationContext)

    {

    var formContext = execuationContext.getFormContext();

    var fromEmailAddress = formContext.getAttribute("msdyncrm_fromemail").getValue();

    console.log(fromEmailAddress);

    var mailformat = /^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/;

    if(fromEmailAddress.match(mailformat))

      {

        alert("Valid email address!");

      }

    else

      {

        alert("Invalid email address!");

      }

    }

    Find this field and add this JS code in the Events tab.  Save and publish.

    8508.png

    23.png

    Here are the test results:

    24.png

    25.png

  • Duy Bao VN1 Profile Picture
    80 on at

    Can we add more condition in this script?

    such as From address/ from name need to be exact matched with below value in the defined list, if not match, show error and stop golive

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Congratulations to our 2025 Community Spotlights

Thanks to all of our 2025 Community Spotlight stars!

Leaderboard > Customer experience | Sales, Customer Insights, CRM

#1
ManoVerse Profile Picture

ManoVerse 202 Super User 2026 Season 1

#2
CU11031447-0 Profile Picture

CU11031447-0 100

#3
NeerajPawar Profile Picture

NeerajPawar 70

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans