‎2011 Oct 29 9:56 AM
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
‎2011 Oct 29 9:39 PM
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
‎2011 Oct 29 11:32 AM
‎2011 Oct 29 11:57 AM
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.
‎2011 Oct 29 9:39 PM
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
‎2011 Oct 31 9:58 AM
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