Value of type cannot be converted to system.net.mail.mailmessage

email
outlook

#1

hello, i have based on this https://www.uipath.com/tutorials/email-automation to actually make this work. at the first step, it already popped up with this message. unlike in the video when the admin typed in “messages” under output MailMessages then “messages” will automatically be created as a variable.

after creating the variable, this popped out. image


#2

Hello Cal!

If you have a look in the Error you can see that its telling you that you have a data type, but the output is expecting another sort of Data type.
Now I am not sure which way around this is (Sorry) but at a guess, it looks like the output wants a System.Collections.Generic.List(Of System.Net.Mail.MailMessage (A list of Mail Messages) and you have handled a SINGLE mail message.

Try put a list of Mail Messages in and let me know :slight_smile:


#3

Hi,
Just hit Ctl+k and name the variable in the “MailMessages” property.


#4

Hi Jordan,

Thanks for the speedy reply! I am in fact unable to locate the list mail messages here.

please advise if i’m doing something wrong.


#5

oh my god. thank you.


#6

Hi Cal,

I understand @ddpadil sorted it out for you :slight_smile:
But for the future, to find a list, you could look for an 'Array ’ data type and for the ‘T’ then put in your MailMessage Data type.

All the best!


#7

I am trying to resolve this error.Can anyone help?

Thanks in advance.


#8

@sreekanth
Put just mail in that activity. It internally goes to the .Attachments collection (similarly how ForEachRow needs a DataTable, not a DataRowCollection).


#9

Thank you