Excel Attachment in E-mail not saving in the path

Hi

Through below ,i can able to save entire e-mail …But i want Excel spread sheet (.xlsx) also saves in that path …it is not happening ?
image

1 Like

Fine
yah you were almost done
may i know what was the issue you were facing
Cheers @allurai_india

the attachments OUTPUT name is “attach” (varaible)

But it is not saving the Excel file in the path …?

image

1 Like

yah it would actually as what you have mentioned is correct
–Your folderpath is correct
–your message property is mentioned with item and i hope the item variable is obtained from the for each loop activity with type argument mentioned as system.net.mail.mailmessage in the property panel of for each activity
–to check whether the file exists or not use a PATH EXISTS actiivty next to this save attachment and mention the file path in the path exists activity which will give us a boolean variable
–we can pass this to a if condition and check if its there it will go to THEN part and use a log message activity with string “exists” or goes to ELSE part with log message activtiy “doesn’t exist”

Cheers @allurai_india

Yes “item” Argument is system.net.mail.mailmessage…but it is not saving my Excel files…

image

Fine have we mentioned the full path of the folder
image

Cheers @allurai_india

yes …i did it for "save attachments " …but no hope …

1 Like

remove that last back slash
it should be like “C:\D DRIVE UP TO NOVEMBER”

Cheers @allurai_india

No hope …

image

1 Like

@allurai_india First check if your mail object has any attachments , if yes in the save attachment activity you just have to pass the mail object and the path where you want to save, if you have multiple attachments you can iterate over to do some operations, if you have a problem with path try saving it in any other folder, you will know the reason why it is not saving. Debugging!

& you can’t print an IEnum directly through message box it is like a list u can print the object of a list.

1 Like

This is strange
but no worries
last and final check is whether we have attachment or not
i hope we dont have any such attachments with the mail

cheers @allurai_india

these are screen shots of my entire …task …

btw …

while saving the e-mail …i change the file name …(although it is saving good …it should not be linked to ATTACHMENTS ??)


1 Like

Fine
place the save attachment before to save mail message activity and try once
Cheers @allurai_india

1 Like

thanks …it is working now …
I forgot to select option "get attachments "…in GET EXCHANGE E-MAIL " …now it is okay .

But i have other problem …i would like to attach the same Excel in e-mail …

1 Like

Fantastic
get the cursor to the blue exclamatory symbol here and share that screenshot buddy
image
Cheers @allurai_india

image

1 Like

@allurai_india how do you know if your attachment is of .xlsx before saving it to a folder, pass the excel full path in the in argument and cmg to the error it is a collection of strings cant join them together.

1 Like

Fine the reason is attach is the output that we get from save attachment which is of type ienumerable which cant be used along with the string
–so use a assign activitiy before to the save attachment and mention lke this
attachmentName = CType(item.Attachments.FirstOrDefault, Attachment)

where attachmentName is a string variable and use that here in the attachfile property instead of variable attach

you were almost done

Cheers @allurai_india

1 Like

i found another way as well…i mention “attach” varaible in attachments collections …

it is working …now …thanks for helping all the way …

image

yes …you are correct …i fixed it now …thanks