If no attachment do not send email

what is the sysntac to check if there is an attachment? Normally I save it in a filepath. So if that file path is empty do not send the email.

thanks for your help
zachvaldezAsked:
Who is Participating?
 
David LeeCommented:
You didn't answer my question, so I'll assume you want to make this test from code and not from a rule.  Testing for the existence of an attachment is done like this:

    if Item.Attachments.Count = 0 Then

You can't check a path or a size since the test would cause errors if there is not attachment.
0
 
David LeeCommented:
Hi zachvaldez,

> what is the sysntac to check if there is an attachment?
Do you mean from code?  I'm also not understanding what a file paht has to do with the existence, or lack thereof, of an attachment.

Cheers!
0
 
zachvaldezAuthor Commented:
I rephrase my question..
If the attachment is < 100 kb
then do not send the email...
0
 
zachvaldezAuthor Commented:
blue, your're right.
I did the other way but same solution you propose

If .attachment.count>0 then
 .send
end if
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.