Sending outlook emails with vote backend

Hi all,

I am currently trying to send outlook emails with votes via a back end way but am currently stumped. Would appreciate any advice or methods on ways of achieving this.

I am aware of methods utilising front end but would much prefer back end if possible.

Thanks for the help in advance!

Hi ,

try this solution

Or Create a Macro like Below
and Execute this code using Invoke code activity

Public Sub CreateVotingMessage()
Dim objMsg As MailItem

Set objMsg = Application.CreateItem(olMailItem)

With objMsg
.Subject = “What’s for lunch?”
.VotingOptions = “Mexican;Italian;Fast Food;Chinese”
.Importance = olImportanceHigh
.ExpiryTime = DateAdd(“d”, 3, Now) '3 days from now
.Display
End With
Set objMsg = Nothing
End Sub

2 Likes

Hi @vinay_reddy

If i were to perform this step, where would i specify

  • Which email address to send to
  • Contents of the email body

The MailItem object has properties for achieving that.

  • Which email address to send to - objMsg.To = " "
  • Contents of the email body - objMsg.Body = " "

Inputting the codes into Invoke Code came up with these errors

In addition, i am not sure where i would input the codes objMsg.To = " " and objMsg.Body = " ".

Thanks for the help @Sowmyalaxmi_Kp! I am unfamiliar with VB and appreciate any help given.

I tried like this, its working…

objMsg.To = “abc@gmail.com”
objMsg.HTMLBody = mailBody
objMsg.BodyFormat = Microsoft.Office.Interop.Outlook.OlBodyFormat.olFormatHTML
objMsg.Send()

But my requirement is I need to call objMsg.Send() outside Invoke Code activity, something using Invoke Method. How can I do it ? I tried to implement but it says "MailItem does not have a public method name ‘Send’ matching the parameter types, generic arguements.