Application Development 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: 

need a way to verify from SAP if an email address really exists

Former Member
0 Kudos
1,259

Hi Guru,

I need a way to verify from SAP if an email address really exists.

Thanks in advance

Soufiene

5 REPLIES 5

Former Member
0 Kudos
402

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

Former Member
0 Kudos
402

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

former_member156446
Active Contributor
0 Kudos
402

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?

Former Member
0 Kudos
402

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

0 Kudos
402

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