In my outlook I have different Mail Boxes, my own and the one of my departament. I want to send emails from my department address and I am doing it by using the property .SentOnBehalfOfName
. I do this from excel and I have office 2010.
Although the emails are being received by the recipients from my department address, those emails are stuck in my personal outbox (like waiting to be sent...). This becomes a problem when the number of emails I send is bigger than 30 because I reach the memory space limit.
Anybody knows how to avoid these emails stuck in my personal outbox?
This is the code I use to send emails:
Sub MandaMail(destinatarios As String, copia As String, subject As String, strbody As String, Optional CO As String = "")
Dim OutApp As Object
Dim OutMail As Object
Dim strbody As String
Dim SigString As String
Dim Signature As String
Set OutApp = CreateObject("Outlook.Application")
Set OutMail = OutApp.CreateItem(0)
On Error Resume Next
With OutMail
.To = destinatarios
.CC = copia
.BCC = CO
.subject = subject
.HTMLBody = strbody
.SentOnBehalfOfName = "mydeparmentemail@mycompany.es"
.send
End With
On Error GoTo 0
Set OutMail = Nothing
Set OutApp = Nothing
Thanks in advance