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

Validate Email id

Former Member
0 Likes
1,325

Hello ppl,

Is there any standard FM to validate the email address.

In my report program, I am allowing the user to enter the email address in the selection screen.

I want to validate this email address before sending a mail.

Declaration:

PARAMETERS: p_mailid TYPE recacommmailpar-smtp_addr. "Mail ID

I am calling the FM: SO_NEW_DOCUMENT_ATT_SEND_API1 to send the email to specified user.

Thanks,

Dawood.

3 REPLIES 3
Read only

Former Member
0 Likes
835

hi

try this

Try with FM - > SX_INTERNET_ADDRESS_TO_NORMAL to validate the email address.

Now run the FM and see...

use cl_http_client class and send a dummy http request to the site to see whether its available or not.

check out the following program for sample code

RSWF_TEST_HTTP

NOTE: if you are connecting to internet via proxy and the url you are trying to reach is on internet.

SICF GOTO->HTTP client proxy settings

in global settings tab

check the check box "proxy setting is active"

and in the "HTTP log" tab

enter proxy host name e.g proxy.sap.com....

enter the proxy server port (generally 80)

if required you need to enter

proxy server authentication (uid/pwd)

Read only

Former Member
0 Likes
835

Hi,

I'm not sure about any FM which can validate an email id.

But I can give you an alternate solution - If there are only a specific set of email ids that the user will use, then you can create a custom table to hold all those email ids & validate the user input against the data in that table.

Hope this helps you.

Regards

Sayee

Read only

Former Member
0 Likes
835

Dawood,

You can validate with ADR6 table field SMTP_ADDR.

Amit.