Variable type mismatch


#1

To get IMAP mail messages i saved those messages in a variable of type System.Collections,Generic.List(System.Net.Mail.MailMessage)
But when I’m trying to save the mail message using the same variable then it shows error "value of System.Collections,Generic.List (Of System.Net.Mail.MailMessage) can’t be converted to System.Net.Mail.MailMessage
(No error is shown in the Get IMAP Mail container but error pops up in the container related to saving mail message)

Please give me some suggestions on how to solve this problem


#2

hope your processing via foreach loop
the variabel which store the mail is in list .So while processing through foreach loop it should item by item
please change the variable type to "System.Net.Mail.MailMessage"


#3

Have a look. I have to complete the body part of foreach.


#4

looks like you got me wrong. :stuck_out_tongue:
Keep your "get IMAP message output variable (eg: mail) type as List of System.Net.Mail.MailMessage

when you pass the same variable (eg:mail) in foreach just change the TypeArgument as “System.Net.Mail.MailMessage” keep default item as it is.

please see the screen shot.


#5

Can you tell me how to save a mail or an attachment? I am facing problems in item.Body.Contains("") part. What should I write in the quotes?


#6

we have save attachment and Save Mail Message activity

if you want to save attachment depends on subject or sender name or any condition for eg.


#7

Why did you take the assignment block?


#8

that’s for further operation on attachment so i can read the excel files from the file path.
Anyway that not required in your case .


#9

It’s not working. The attachment doesn’t get downloaded, nor the further sequence gets executed.


#10

whats the error? attach workflow.


#11

There isn’t any sort of error.


#12

after condition does it entering into “then” sequence ?
if not make sure your subject is right. just change subject as “document_Sana”


#13

Nothing seems to work I’m afraid. I’m stuck with this.


#14

:thinking: does your Get IMAP Mail Messaging reading the mail?


#15

It just opens up the gmail.com page and nothing else


#16

by default “OnlyUnReadMessages” checked .
please keep some unread mail in gmail and try again.


#17

What should be the variable type of password?


#18

its just a string


#19

Still not working. Should I leave this and try other samples?


#20

sure. I don’t know why you unable to do so.:frowning:
All the best.