Ik heb 2 accounts in mijn Outlook.
karel@mailadres.be
no-reply@mailadres.be
Ik gebruik onderstaande code om mails te versturen.
Hoe kan ik er voor zorgen dat de mail altijd verstuurd wordt vanaf het adres 'no-reply@maildres.be'?
karel@mailadres.be
no-reply@mailadres.be
Ik gebruik onderstaande code om mails te versturen.
Hoe kan ik er voor zorgen dat de mail altijd verstuurd wordt vanaf het adres 'no-reply@maildres.be'?
Code:
Sub PDFEmail()
Set OutApp = GetObject(, "Outlook.Application")
Set OutApp = CreateObject("Outlook.Application")
OutApp.Session.Logon
Set OutMail = OutApp.CreateItem(0)
xOutMsg = "Beste klant,<br/><br />" & _
"Binnen afzienbare tijd <br/><br />" & _
"Dit is een automatisch verstuurde mail. Op deze mail kan niet geantwoord worden."
With OutMail
.To = Range("F3").Value
.CC = ""
.BCC = ""
.Subject = "Planning productie"
.HTMLBody = xOutMsg
'.HTMLBody = xOutMsg & "<br/>" & "<img scr = 'c:\Gebruikers\gebruiker\AppData\Roaming\Microsoft\Signatures\Logo.png'/>"
.Send
End With
Set OutMail = Nothing
Set OutApp = Nothing
End Sub