Xp_readmail

Jan 21, 2004

How can i read all mails from outlook using xp_readmail and xp_findnextmsg
i am able to read only the first mail from the inbox

please help

my code is given below


DECLARE @status2 int
declare @status int
declare @message_id varchar(200)
DECLARE @message varchar(8000), @dateRecive varchar(255),@subject varchar(255)
DECLARE @subjectMessage varchar(255), @unread varchar(5) ,@unreadFl varchar(5)
DECLARE @originator_address varchar(255), @sendBy varchar(255)DECLARE @i int
DECLARE @attachments varchar(255), @attachmentsMessage varchar(255)
EXEC @status2 = xp_findnextmsg @msg_id = @message_id OUTPUT

EXEC @status = xp_readmail @msg_id =@message_id ,@originator_address = @sendBy OUTPUT ,

@unread = @unreadFl OUTPUT , @message =@message OUTPUT , @date_received = @dateRecive OUTPUT

, @subject = @subjectMessage OUTPUT , @attachments = @attachmentsMessage OUTPUT

print @message
print @dateRecive
print @subjectMessage
print @unreadFl
print @sendBy
print @attachmentsMessage

View 9 Replies


ADVERTISEMENT

Trouble With Xp_readmail

Nov 17, 2000

Hello,
I've got some trouble when using xp_readmail.I check the email count and saved the attached files in c:winnt.
The problem is when the attached files are saved cause the file name is cut in dos format (8 characters + . + 3 characters) but my file's name is like toto.tutu.titi_tata.txt so is there a way to keep the name unchanged when saving attached files ?
Thanks for your answers

View 1 Replies View Related

Xp_readmail Failed

Mar 30, 2006

Hi,

I'm using sql server 2000 and Im trying to execute an sql in an email, using xp_readmail. But I keep pn getting this error. "xp_readmail: failed with mail error 0x8004010f". I am able to execute xp_sendmail though.

Can anyone please help?

Thanks in advance.

View 1 Replies View Related

Reading Mail Without Xp_readmail

Oct 18, 2007

Guys, I've been Googling for quite some time now. Is there a way to read mail from SQL Server without using the soon to be deprecated "xp_readmail" and XP Mail procedures.

Apparently Database Mail lacks this too. I'm looking into SSIS however there doesn't seem to be a simple solution.

View 1 Replies View Related

Xp_readmail Truncates Message

Dec 30, 2004

I am using (or trying to) xp_readmail to import email into a table for further processing. I am using the following line to bring the email into a table (this is part of a larger stored procedure):

insert email_import exec master.dbo.xp_readmail

However, the email message is always truncated at 250 characters.

BOL says:

[@message =] 'message' Is the returned body or the actual text of the mail message. message is text, with no default.

I am at a loss here and I really need to get the entire message body into the imprt table so that I can parse the subject line to identify the row in the destination table to update with the email message body. Anybody have any ideas?? Thanks...

View 3 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved