Hi All
We are using an code to sent out E-Mails to our colleagues in Blue Prism, which were written on Win 7 and we used a shared Mailbox Address to sent out them. After the Migration to Win 10, the code is working, but not give us the Output, if the E-Mail was sent out and secondly, the code is using the primary account (user MailAddress) instead of the Mail Address of the shared Mailbox. I adjust several times, the code, but it isn't working.
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 = mailFrom
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
Thanks for your support
BR
Andre
------------------------------
Andre Koepplin
Senior Business Process Analyst
Wroclaw/Poland
------------------------------