SoftTree Technologies SoftTree Technologies
Technical Support Forums
RegisterSearchFAQMemberlistUsergroupsLog in
Email Watch & SendMailWithAttachment

 
Reply to topic    SoftTree Technologies Forum Index » 24x7 Scheduler, Event Server, Automation Suite View previous topic
View next topic
Email Watch & SendMailWithAttachment
Author Message
Sam Mills



Joined: 29 Sep 2000
Posts: 9

Post Email Watch & SendMailWithAttachment Reply with quote

I have the evaluation copy of 24x7 Scheduler v2.3.5. I'm having problems using the Email Watch feature. I setup a job with the correct Email Account & Password. the correct Subject & Text search strings but the job never fires and the attachment is never extracted. I can watch 24x7 Scheduler open/read the unread email, but it does not trigger the job to execute. I can run the job manually with no problem. I'm on Microsoft Outlook 97. Should I be on a later version.

In addition, MailSendWithAttachment gives me an error when I have multiple attachments separated by commas.

Are the above known problem. I would really like to purchase the product if can get these problems resolved.

Thanks
Sam Mills

Fri Sep 29, 2000 4:48 pm View user's profile Send private message
SysOp
Site Admin


Joined: 26 Nov 2006
Posts: 6485

Post Re: Email Watch & SendMailWithAttachment Reply with quote

If you don't use wildcards you should specify exact subject and message text including all non-displayed characters including spaces, end of lines, carriage returns, tabs, etc... If there is at least one character different, your message will not be found.

What is the error message returned by MailSendWithAttachment?
Can you post your code here?

: I have the evaluation copy of 24x7 Scheduler v2.3.5. I'm having problems
: using the Email Watch feature. I setup a job with the correct Email
: Account & Password. the correct Subject & Text search strings but
: the job never fires and the attachment is never extracted. I can watch
: 24x7 Scheduler open/read the unread email, but it does not trigger the job
: to execute. I can run the job manually with no problem. I'm on Microsoft
: Outlook 97. Should I be on a later version.

: In addition, MailSendWithAttachment gives me an error when I have multiple
: attachments separated by commas.

: Are the above known problem. I would really like to purchase the product if
: can get these problems resolved.

: Thanks
: Sam Mills

Fri Sep 29, 2000 9:19 pm View user's profile Send private message
Sam Mills



Joined: 29 Sep 2000
Posts: 9

Post Re: Email Watch & SendMailWithAttachment Reply with quote

: If you don't use wildcards you should specify exact subject and message text
: including all non-displayed characters including spaces, end of lines,
: carriage returns, tabs, etc... If there is at least one character
: different, your message will not be found.

: What is the error message returned by MailSendWithAttachment?
: Can you post your code here?

I wasn't sure how much of the code you wanted so I gave you the entire script.
I hardcoded the file path of the 2 attachments for this test. The filenames are normally passed in a variable call FileLocation. See the commented-out line above the current SendMessageWithAttachment.

Start of code--------------------
Dim rows, number
Dim QueryString, String
Dim found, boolean
Dim ToAddr, String
Dim cc, String
Dim Bcc , String
Dim Subject, String
Dim Body, String
Dim FileLocation, String
Dim RecipientName, String
Dim SendDate, String
Dim EmailOutID, String
Dim RowsAffected, Number
Dim problem, boolean
Dim CurrentDate, date
Dim CurrentTime, Time
Dim CurrentDateTime, Datetime
Dim RowsAffected, Number

Today(CurrentDate)
Now(CurrentTime)

DateTime ( CurrentDate, CurrentTime, CurrentDateTime)

DatabaseConnect( "EDT" )

ConcatEx("Execute spGetEDTEmailInfo2" , QueryString)
DatabaseRetrieve( QueryString, rows )

IsEqual( rows, 0, problem )

IfThen( problem, STOP )

isGreater( rows, 0, found)

LoopWhile( found, ENDLOOP )

DatabaseGet( rows, 1,ToAddr )

DatabaseGet( rows, 2, cc )

DatabaseGet( rows, 3,Bcc )

DatabaseGet( rows, 4,Subject )

DatabaseGet( rows, 5,Body )

DatabaseGet( rows, 6,FileLocation )

DatabaseGet( rows, 7,RecipientName )

DatabaseGet( rows, 8,SendDate )

DatabaseGet( rows, 9,EmailOutID )

//MailSendWithAttachment "ATLAEXCHMBZ","xyx", RecipientName,Subject, Body, FileLocation

MailSendWithAttachment "ATLAEXCHMBZ","xyz", RecipientName, Subject, Body, & "C:\AUTODSN.log, C:\WINNT\Profiles\smills.000\Personal\tcpip.xls"

//MailSendWithAttachment ToAddr, "", RecipientName, Subject, Body, FileLocation

ConcatEx("Execute spUdpEDTEmailSendDate ",EmailOutID,","," ","'",CurrentDateTime,"'", QueryString)

DatabaseExecute QueryString, RowsAffected

Subtract rows, 1, rows

isGreater( rows, 0, found)

ENDLOOP:

DatabaseDisconnect( )
Exit

STOP:

// Problem: job record not found or found more than one.

// Disconnect from database and notify staff

DatabaseDisconnect()

// MailSend ... error occured ...

End of code----------------------

The error message was "An error occured while executing 24x7 script
Line 57: Sending mail failed Mail Return Failure.

Line 57 is the SendMailWithAttachment line. Be aware on the word wrap.

I will retest the Email Watch problem.

I hope this helps

Sam Mills - sam_mills@es.adp.com


Mon Oct 02, 2000 9:31 am View user's profile Send private message
Tony Gray



Joined: 29 Sep 2000
Posts: 2

Post Re: Email Watch & SendMailWithAttachment Reply with quote

You forgot about 24x7 "special ASCII characters" such as "\t". Either turn them off in the system options (see Tools/Options, Editor tab) or use double backslashes instead of single backslahses or use file names in upper case.

In your case, the following line
MailSendWithAttachment "ATLAEXCHMBZ","xyz", &
RecipientName, Subject, Body, & "C:\AUTODSN.log, &
C:\WINNT\Profiles\smills.000\Personal\tcpip.xls"

will produce an error as the second file name will be
C:\WINNT\Profiles\smills.000\Personal[tab here]cpip.xls"
and so the file will not be found

: I wasn't sure how much of the code you wanted so I gave you the entire
: script.
: I hardcoded the file path of the 2 attachments for this test. The filenames
: are normally passed in a variable call FileLocation. See the commented-out
: line above the current SendMessageWithAttachment.

: Start of code--------------------
: Dim rows, number
: Dim QueryString, String
: Dim found, boolean
: Dim ToAddr, String
: Dim cc, String
: Dim Bcc , String
: Dim Subject, String
: Dim Body, String
: Dim FileLocation, String
: Dim RecipientName, String
: Dim SendDate, String
: Dim EmailOutID, String
: Dim RowsAffected, Number
: Dim problem, boolean
: Dim CurrentDate, date
: Dim CurrentTime, Time
: Dim CurrentDateTime, Datetime
: Dim RowsAffected, Number

: Today(CurrentDate)
: Now(CurrentTime)

: DateTime ( CurrentDate, CurrentTime, CurrentDateTime)

: DatabaseConnect( "EDT" )

: ConcatEx("Execute spGetEDTEmailInfo2" , QueryString)
: DatabaseRetrieve( QueryString, rows )

: IsEqual( rows, 0, problem )

: IfThen( problem, STOP )

: isGreater( rows, 0, found)

: LoopWhile( found, ENDLOOP )

: DatabaseGet( rows, 1,ToAddr )

: DatabaseGet( rows, 2, cc )

: DatabaseGet( rows, 3,Bcc )

: DatabaseGet( rows, 4,Subject )

: DatabaseGet( rows, 5,Body )

: DatabaseGet( rows, 6,FileLocation )

: DatabaseGet( rows, 7,RecipientName )

: DatabaseGet( rows, 8,SendDate )

: DatabaseGet( rows, 9,EmailOutID )

: //MailSendWithAttachment "ATLAEXCHMBZ","xyx",
: RecipientName,Subject, Body, FileLocation

: MailSendWithAttachment "ATLAEXCHMBZ","xyz",
: RecipientName, Subject, Body, & "C:\AUTODSN.log,
: C:\WINNT\Profiles\smills.000\Personal\tcpip.xls"

: //MailSendWithAttachment ToAddr, "", RecipientName, Subject, Body,
: FileLocation

: ConcatEx("Execute spUdpEDTEmailSendDate
: ",EmailOutID,",","
: ","'",CurrentDateTime,"'", QueryString)

: DatabaseExecute QueryString, RowsAffected

: Subtract rows, 1, rows

: isGreater( rows, 0, found)

: ENDLOOP: DatabaseDisconnect( )
: Exit

: STOP: // Problem: job record not found or found more than one.

: // Disconnect from database and notify staff

: DatabaseDisconnect()

: // MailSend ... error occured ...

: End of code----------------------

: The error message was "An error occured while executing 24x7 script
: Line 57: Sending mail failed Mail Return Failure.

: Line 57 is the SendMailWithAttachment line. Be aware on the word wrap.

: I will retest the Email Watch problem.

: I hope this helps

: Sam Mills - sam_mills@es.adp.com

Mon Oct 02, 2000 10:48 am View user's profile Send private message
Sam Mills



Joined: 29 Sep 2000
Posts: 9

Post Re: Email Watch & SendMailWithAttachment Reply with quote

: You forgot about 24x7 "special ASCII characters" such as
: "\t". Either turn them off in the system options (see
: Tools/Options, Editor tab) or use double backslashes instead of single
: backslahses or use file names in upper case.

: In your case, the following line
: MailSendWithAttachment "ATLAEXCHMBZ","xyz", &
: RecipientName, Subject, Body, & "C:\AUTODSN.log, &
: C:\WINNT\Profiles\smills.000\Personal\tcpip.xls"

: will produce an error as the second file name will be
: C:\WINNT\Profiles\smills.000\Personal[tab here]cpip.xls"
: and so the file will not be found

Takes Tony for your suggestion, but I'm still getting the same error as mentioned above. I performed the following tests with no success.

1) Tried using the escape character with "Search for special characters" enabled
MailSendWithAttachment "ATLAEXCHMBZ","xyz", RecipientName, Subject, Body, &
"C:\AUTODSN.log, C:\WINNT\Profiles\smills.000\Personal\\tcpip.xls"

2) Tried disabling "Search for special characters" and removing the escape character.
MailSendWithAttachment "ATLAEXCHMBZ","xyz", RecipientName, Subject, Body, &
"C:\AUTODSN.log, C:\WINNT\Profiles\smills.000\Personal\tcpip.xls"

3)Tried removing the path from the filename and used CD(dir) to change the current directory. Both files are in the root directory of C:.
cd ("c:\")
MailSendWithAttachment "ATLAEXCHMBZ","xyz", RecipientName, Subject, Body, & "AUTODSN.LOG, EXEMGR.EXE"

All of these tests gave the same error.

An error occured while executing 24x7 script
Lin 57: Sending mail failed. Mail Return Failure

In all of these tests, if I remove one filename the statement works perfectly.

Sam


Mon Oct 02, 2000 11:49 am View user's profile Send private message
SysOp
Site Admin


Joined: 26 Nov 2006
Posts: 6485

Post Re: Email Watch & SendMailWithAttachment Reply with quote

Try removing space between file names

: Takes Tony for your suggestion, but I'm still getting the same error as
: mentioned above. I performed the following tests with no success.

: 1) Tried using the escape character with "Search for special
: characters" enabled
: MailSendWithAttachment "ATLAEXCHMBZ","xyz",
: RecipientName, Subject, Body, &
: "C:\AUTODSN.log, C:\WINNT\Profiles\smills.000\Personal\\tcpip.xls"

: 2) Tried disabling "Search for special characters" and removing the
: escape character.
: MailSendWithAttachment "ATLAEXCHMBZ","xyz",
: RecipientName, Subject, Body, &
: "C:\AUTODSN.log, C:\WINNT\Profiles\smills.000\Personal\tcpip.xls"

: 3)Tried removing the path from the filename and used CD(dir) to change the
: current directory. Both files are in the root directory of C:.
: cd ("c:\")
: MailSendWithAttachment "ATLAEXCHMBZ","xyz",
: RecipientName, Subject, Body, & "AUTODSN.LOG, EXEMGR.EXE"

: All of these tests gave the same error.

: An error occured while executing 24x7 script
: Lin 57: Sending mail failed. Mail Return Failure

: In all of these tests, if I remove one filename the statement works
: perfectly.

: Sam

Mon Oct 02, 2000 12:46 pm View user's profile Send private message
Sam Mills



Joined: 29 Sep 2000
Posts: 9

Post Re: Email Watch & SendMailWithAttachment Reply with quote

: Try removing space between file names

Problem #1
Tried removing spaces in filename. No change. Still get same error message.

Problem #2
In my initial message I referenced a problem with Email watch. I did serveral tests after getting your message. It seems that the scheduler is mistaking the attachment as message text. I have the job setup with the subject text as "test" minus the quotes and the message text as blank. Whenever I send myself a message without an attachment the job is triggered OK. but, as soon as I added an attachment the mail item is opened but the job is not triggered and the attachment is not saved.

Any ideas?

Sam

Mon Oct 02, 2000 3:15 pm View user's profile Send private message
SysOp
Site Admin


Joined: 26 Nov 2006
Posts: 6485

Post Re: Email Watch & SendMailWithAttachment Reply with quote

Problem #1
The bad news: It appears that some MAPI clients require that every attachment has a unique "position" id inside an email message. May be this is the case here. 24x7 currently does not use that MAPI property (attachment position).
The good news: An enhancement request has been submitted to include this feature. It will be provided with the 24x7 Scheduler v2.3.7, which will be released later this week.

Problem #2
Make sure you send your messages in a "plain text" format (not "HTML" and not "RTF")

: Problem #1
: Tried removing spaces in filename. No change. Still get same error message.

: Problem #2
: In my initial message I referenced a problem with Email watch. I did serveral
: tests after getting your message. It seems that the scheduler is mistaking
: the attachment as message text. I have the job setup with the subject text
: as "test" minus the quotes and the message text as blank.
: Whenever I send myself a message without an attachment the job is
: triggered OK. but, as soon as I added an attachment the mail item is
: opened but the job is not triggered and the attachment is not saved.

: Any ideas?

: Sam

Mon Oct 02, 2000 9:49 pm View user's profile Send private message
SysOp
Site Admin


Joined: 26 Nov 2006
Posts: 6485

Post Re: Email Watch & SendMailWithAttachment Reply with quote

Sorry, I still think that one of your file names is invalid 9probably the XLS file).
After some testing I found out that Netscape Messenger cannot sent attachments without "position" but it causes totally different error message

Please check your file names again. Note that Windows sometimes shows virtual folders and files that exist physically in some other location (you know this NT computer sharing issues with different user profiles)

: Problem #1
: Tried removing spaces in filename. No change. Still get same error message.

: Problem #2
: In my initial message I referenced a problem with Email watch. I did serveral
: tests after getting your message. It seems that the scheduler is mistaking
: the attachment as message text. I have the job setup with the subject text
: as "test" minus the quotes and the message text as blank.
: Whenever I send myself a message without an attachment the job is
: triggered OK. but, as soon as I added an attachment the mail item is
: opened but the job is not triggered and the attachment is not saved.

: Any ideas?

: Sam

Tue Oct 03, 2000 11:26 am View user's profile Send private message
Sam Mills



Joined: 29 Sep 2000
Posts: 9

Post Re: Email Watch & SendMailWithAttachment Reply with quote

: Problem #1
: The bad news: It appears that some MAPI clients require that every attachment
: has a unique "position" id inside an email message. May be this
: is the case here. 24x7 currently does not use that MAPI property
: (attachment position).
: The good news: An enhancement request has been submitted to include this
: feature. It will be provided with the 24x7 Scheduler v2.3.7, which will be
: released later this week.

: Problem #2
: Make sure you send your messages in a "plain text" format (not
: "HTML" and not "RTF")

Problem #1
Thanks, I will wait for the new release v2.3.7. Any info on only enhancements included in this release?

Problem #2
How can I tell if I'm sending an email "RTF" or "Plain text". I don't see any reference to these formats under options. My assumption is that I am using "Plain text" but I can't verify. Is there a way to prevent my system from receiving "RTF" or "HTML" from the outside? We will be receiving emails from clients that contain attachments. I want to be able to identify the email and extract the attachment.

Problem #3
If have a new question/problem. Is there a way to Call a function from an ActiveX DLL created via Visual Basic. I get and error message saying Procedure: DisplayMessage can not be found. DisplayMessage is the function I'm calling. I notice your example only uses the Windows API.

Wed Oct 04, 2000 12:53 pm View user's profile Send private message
SysOp
Site Admin


Joined: 26 Nov 2006
Posts: 6485

Post Re: Email Watch & SendMailWithAttachment Reply with quote

The other change is a fix for semaphore file handling by 24x7 remote agents

Re: Problem #3
The name of the function can be different in DLL (or may by just a function number in a virtual table) vs. name of it in your VB code. Also make sure that function is exported and compiled using _stdcall calling conventions. Use a DLL dependency viewer available with VisualStudio to lookup function naems.

: Problem #1
: Thanks, I will wait for the new release v2.3.7. Any info on only enhancements
: included in this release?

: Problem #2
: How can I tell if I'm sending an email "RTF" or "Plain
: text". I don't see any reference to these formats under options. My
: assumption is that I am using "Plain text" but I can't verify.
: Is there a way to prevent my system from receiving "RTF" or
: "HTML" from the outside? We will be receiving emails from
: clients that contain attachments. I want to be able to identify the email
: and extract the attachment.

: Problem #3
: If have a new question/problem. Is there a way to Call a function from an
: ActiveX DLL created via Visual Basic. I get and error message saying
: Procedure: DisplayMessage can not be found. DisplayMessage is the function
: I'm calling. I notice your example only uses the Windows API.

Wed Oct 04, 2000 4:08 pm View user's profile Send private message
Display posts from previous:    
Reply to topic    SoftTree Technologies Forum Index » 24x7 Scheduler, Event Server, Automation Suite All times are GMT - 4 Hours
Page 1 of 1

 
Jump to: 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


 

 

Powered by phpBB © 2001, 2005 phpBB Group
Design by Freestyle XL / Flowers Online.