Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

email notification

Former Member
0 Likes
644

Hi Friends,

As I am sending adobe form document as an attachment through mail.

when i enter incorrect email id(1234erdydyuforsap.com).....i get notification though system...that is fine....

but i send mail with incorrect id other than sap mail id like(123jdhdueiuo90forgmail.com).....in this case i am not getting any notification .....like in first case....

can you suggest me the correct reason for this ....

kind regards

rahul

1 ACCEPTED SOLUTION
Read only

Clemenss
Active Contributor
0 Likes
591

Hi Rahul,

you can validate the mails address using ABAP REGEX featur with this regular expression:

FIND REGEX '\w+(\.\w+)*@(\w+\.)+(\w{2,4})' IN '1234erdydyuforsap.com'.
IF SY-SUBRC = 0.
  --> send mail
ELSE.
  --> handle error
ENDIF.

Regards,

Clemens

4 REPLIES 4
Read only

former_member209696
Participant
0 Likes
591

Hi,

Post your validation code also

Read only

0 Likes
591

you better do the email validation before proceeding to send a mail

IF EMAIL VALIDATION IS TRUE,
THEN PROCEED TO PROGRAM,
ELSE
ERROR MESSAGE!!
ENDIF.

Read only

Clemenss
Active Contributor
0 Likes
592

Hi Rahul,

you can validate the mails address using ABAP REGEX featur with this regular expression:

FIND REGEX '\w+(\.\w+)*@(\w+\.)+(\w{2,4})' IN '1234erdydyuforsap.com'.
IF SY-SUBRC = 0.
  --> send mail
ELSE.
  --> handle error
ENDIF.

Regards,

Clemens

Read only

Former Member
0 Likes
591

Validate your E-Mail address Before Calling mail Sending... you can use like this

DATA email TYPE string ...." Here you can pass your E-Mail Address

DATA matcher TYPE REF TO cl_abap_matcher.

matcher = cl_abap_matcher=>create(

pattern = `\w(\.\w)*@(\w\.)(\w{2,4})`

text = email ).

IF matcher->match( ) IS INITIAL.

MESSAGE 'Invalid e-mail' TYPE 'I' DISPLAY LIKE 'E'.

ENDIF.

<removed by moderator>

Thanks

Regards,

Sushil

Edited by: Thomas Zloch on Oct 31, 2011 11:40 AM