Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 Email Script

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2004-05-26 : 07:03:03
Khalid Abbasi writes "I want to write a script or stored procedure that read all my email from company email account every hour and than save it in a table on a SQL server. How I can achieve this?"

JellyRoll
Starting Member

8 Posts

Posted - 2004-05-26 : 09:09:27
Khalid,
SQL Mail will allow you to send/receive email using xp_readmail and return the mail data into some variables in your stored procedure. It requires that a MAPI client is installed (Windows Messaging, Outlook...), which is undesirable for some DBAs. (I'd like to avoid installing it!)

Otherwise, you could write a J/VB script using a third-party POP3 client that reads messages that you want and returns some data that you can get to from the Return value of xp_cmdshell.

Sending mail using CDO/CDONTS is much less of a hassle than trying to read it with MAPI!
Go to Top of Page
   

- Advertisement -