MS Outlook VBO
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
22-05-19 03:33 PM
I am looking to use the Outlook VBO to send emails as I need to use HTML enabled for the formatting.
I need to be able to send from a shared mailbox.
Does anybody have the code required to either amend the 'Send Email' action
or create a 'Send Email From' action.
(I can not use the POP3/SMTP object)
------------------------------
Declan Keeton
RPA Developer
E.ON
------------------------------
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
22-05-19 03:44 PM
Edit: Redoing this post, because I initially misread the query. (Thank you BP, for finally allowing edits!)
Just before the mail.save and mail.send lines, add this:
Inputs:
[SendFrom] - Text
Code:
if SendFrom <> Nothing mail.SentOnBehalfOfName = SendFrom end if
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
23-05-19 09:08 AM
Hi Ami,
Thanks to the forums for the edits as much happier with the edited than the original reply!
This worked perfectly and was quick to implement.
Thanks mate!
------------------------------
Declan Keeton
RPA Developer
E.ON
------------------------------
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
20-09-19 07:27 AM
I saw, that you support Declan by an issue with Outlook and Sent E-Mails on Behalf. I have the problem, that I cant sent E-Mails on behalf with this code from a shared mailbox. Maybe you can give me an hint, what I am doing wrongly? Secondly, I am also not got the output that thee E-Mail was sent.
Dim oApp As Microsoft.Office.Interop.Outlook._Application
oApp = New Microsoft.Office.Interop.Outlook.Application
Dim myItem As Microsoft.Office.Interop.Outlook.MailItem
try
myItem = oApp.CreateItemFromTemplate(templatePath)
myItem.From = FromAddress
myItem.To = mailAddress
myItem.Subject = myItem.Subject _
.Replace("<Name>", firstName) _
.Replace("<Surname>", lastName)
myItem.HTMLBody = myItem.HTMLBody _
.Replace( _
"<span style='background:silver;mso-highlight:silver'>Ms. X</span> / <span style='background:silver;mso-highlight:silver'>Mr. Y</span>", firstLine) _
.Replace( _
"<span style='background:silver;mso-highlight:silver'>Sehr geehrte Frau X</span> / <span style='background:silver;mso-highlight:silver'>Sehr geehrter Herr Y</span>", firstLine) _
.Replace( _
"<span lang=FR style='mso-bidi-font-family:""xxxx Type Light"";background:lightgrey;mso-highlight:lightgrey;mso-ansi-language:FR'>Madame </span><span lang=FR style='mso-bidi-font-family:""XXXX Type Light"";mso-ansi-language:FR'>, / <span style='background:lightgrey;mso-highlight:lightgrey'>Monsieur</span>,</span>", firstLine) _
.Replace( _
"<span lang=IT style='mso-bidi-font-family:""xxxx Type Light"";background:lightgrey;mso-highlight:lightgrey;mso-ansi-language:IT'>Gentile signora X</span><span lang=IT style='mso-bidi-font-family:""xxxx Type Light"";mso-ansi-language:IT'> / <span style='background:lightgrey;mso-highlight:lightgrey'>Egregio signor Y</span></span>", firstLine)
If(itMailInside.Length > 1)
myItem.HTMLBody = myItem.HTMLBody _
.Replace( _
"<span style='background:lightgrey;mso-highlight:lightgrey'>tenuta</span> / <span style='background:lightgrey;mso-highlight:lightgrey'>tenuto</span>", itMailInside)
End If
myItem.Send()
mailSent = True
mailSent = False
If myItem Is Nothing
Else
myItem.Close(Microsoft.Office.Interop.Outlook.OlInspectorClose.olDiscard)
End If
Catch ex as Exception
End try
------------------------------
Andre Koepplin
Business Process Analyst
Wroclaw
------------------------------
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
23-09-19 06:33 PM
------------------------------
Ami Barrett
Lead RPA Software Developer
Solai & Cameron
America/Chicago
------------------------------
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
24-09-20 01:31 PM
------------------------------
Sophie Katherine Smith
HR Systems, Data and Quality Assurance Manager
Arup
Europe/London
------------------------------
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
24-09-20 04:18 PM
Typically, if an invalid address is specified, Outlook will still successfully send the message. In cases like this, the postmaster/daemon would handle the invalid recipient and send back a message stating that the destination would be invalid. I would think the only way to validate programmatically, is to check for a bounced e-mail in the inbox.
------------------------------
Ami Barrett
Sr Product Consultant
Blue Prism
Plano, TX
------------------------------
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
24-09-20 04:31 PM
------------------------------
Sophie Katherine Smith
HR Systems, Data and Quality Assurance Manager
Arup
Europe/London
------------------------------
