Uso essa macro para enviar e-mail automático, porem o e- mail so é enviado depois que eu abro o Outlook, depois que o Outlook abre aparece atualizando pastas, e envia o e-mail.
gostaria de saber se envia mesmo sem precisar abrir o outlook ?
Dim xOutApp As Object
Dim xOutMail As Object
Dim xMailBody As String
Set xOutApp = CreateObject("Outlook.Application")
Set xOutMail = xOutApp.CreateItem(0)
xMailBody = "Operador/Auxiliar: " & Cells(e, 7) & vbNewLine & vbNewLine & _
"Chapa: " & Cells(e, 6) & vbNewLine & _
"Área: " & Cells(e, 8) & vbNewLine & _
"Máquina ou Área comprometida: " & Cells(e, 14) & vbNewLine & _
"Problemas: " & Cells(e, 16) & vbNewLine & _
"Nível de risco: " & Cells(e, 13) & vbNewLine & _
"Condições de risco: " & Cells(e, 12) & vbNewLine & _
"Mecânica/Elétrica: " & Cells(e, 15) & vbNewLine & _
"Cor da etiqueta: " & Cells(e, 11) & vbNewLine & vbNewLine & _
"Nºordem: " & Cells(e, 1) & vbNewLine & _
"-" & Cells(e, 5) & vbNewLine & _
"-" & Cells(e, 3) & vbNewLine & _
"Nº O.S:" & Cells(e, 4) & vbNewLine & _
""
On Error Resume Next
With xOutMail
.To = Cells(e, 17)
.CC = ""
.BCC = ""
.Subject = Cells(e, 8) & " - Uma etiqueta foi aberta"
.Body = xMailBody
.attachments.Add ActiveWorkbook.FullName
.Send
End With
On Error GoTo 0
Set xOutMail = Nothing
Set xOutApp = Nothing
abs,