Following procedure can be used to read emails from exchange server,
declare
cursor c1 is
select * from table(mail_client.get_mail_headers());
begin
mail_client.connect_server(
p_hostname => '192.168.1.2', -- Exchange server
p_port => 143,
p_protocol => 'imap',
p_userid => 'info@erpstuff.com',
p_passwd => 'ERPSTUFF',
p_ssl => false
);
dbms_output.put_line('Connected to ^MAILSERV.:^MAILPORT using the ^MAILPROT. protocol.');
mail_client.open_inbox;
dbms_output.put_line('Mailbox successfully opened.');
--dbms_output.put_line('The INBOX folder contains '||mail_client.get_message_count||' messages.');
FOR r1 in C1 LOOP
dbms_output.put_line(r1.msg_number, r1.subject, r1.sender, r1.sender_email, r1.sent_date);
END LOOP;
mail_client.close_folder;
mail_client.disconnect_server;
end;
How to read emails from exchange server?
Who is online
Users browsing this forum: Google Adsense [Bot] and 8 guests