2009 Nov 30 10:14 PM
Hi Guru,
I need a way to verify from SAP if an email address really exists.
Thanks in advance
Soufiene
2009 Nov 30 10:34 PM
You can do some validation like looking for an '@', but if it passes all the validations, I think all you can do is send an e-mail. If it bounces, it doesn't exist.
Rob
2009 Dec 01 2:08 AM
Hi,
Try using this FM
SX_INTERNET_ADDRESS_TO_NORMAL
This function module check for all possible errors. But can't check wheather exist or not
l_address-type = 'INT'.
l_address-address = i_upload-smtp_addr_025.
CALL FUNCTION 'SX_INTERNET_ADDRESS_TO_NORMAL'
EXPORTING
address_unstruct = l_address
COMPLETE_ADDRESS = 'X'
IMPORTING
ADDRESS_NORMAL =
LOCAL =
DOMAIN =
COMMENT =
addr_normal_no_upper = l_addrnormal
EXCEPTIONS
error_address_type = 1
error_address = 2
error_group_address = 3
OTHERS = 4
.
Regards,
Madhu
2009 Dec 01 5:15 AM
i doubt if there is an options in SAP to check the existence of an email id.
Leave the world of SAP is there any tool that exists out of SAP which check if the ID exists, without sending any email to the ID?
2009 Dec 01 6:05 AM
Hello,
Try the following code. It gives an option of using a webservice to validate an email address. This piece of code may help in solving your query.
PARAMETERS: p_mail(100) LOWER CASE. " E-Mail id to be verified
DATA: http_client TYPE REF TO if_http_client .
DATA: w_string TYPE string ,
w_result TYPE string ,
r_str TYPE string .
DATA: result_tab TYPE TABLE OF string.
START-OF-SELECTION .
CLEAR w_string .
CONCATENATE
'http://www.webservicex.net/ValidateEmail.asmx/IsValidEmail?Email=' p_mail
INTO
w_string .
CALL METHOD cl_http_client=>create_by_url
EXPORTING
url = w_string
IMPORTING
client = http_client
EXCEPTIONS
argument_not_found = 1
plugin_not_active = 2
internal_error = 3
OTHERS = 4.
CALL METHOD http_client->send
EXCEPTIONS
http_communication_failure = 1
http_invalid_state = 2.
CALL METHOD http_client->receive
EXCEPTIONS
http_communication_failure = 1
http_invalid_state = 2
http_processing_failed = 3.
CLEAR w_result .
w_result = http_client->response->get_cdata( ).
REFRESH result_tab .
SPLIT w_result AT cl_abap_char_utilities=>cr_lf INTO TABLE result_tab .
READ TABLE result_tab INTO r_str INDEX 2.
IF r_str+44(1) = 't'.
WRITE:/ 'Valid email address'.
ELSE.
WRITE:/ 'Invalid email address'.
ENDIF.
Regards,
Sachin
2009 Dec 02 9:22 PM
Thank you for your response , the webservices are ofttn busy , i had an error .
I want to READ XML to verify the boolean tag , how i can do it ?
When i got the result , i want to read directly the tag to verify if it is true or false ?
Thanks a lot
Soufiene