2
Hello, I need to send several emails to different addresses automatically, but when the VBA
starts the sending process opens an alert box requesting my permission to complete the task.
Does anyone know how to override this alert and send the email?
The email sending code:
Function Enviar_dados_celulas_email(subject As String, destiny As String, body As Range, introductin As String)
' selecão da planilha desejada.
If destiny <> "" Then
body.Select
ActiveWorkbook.EnvelopeVisible = True
End If
With ActiveSheet.MailEnvelope
.Introduction = introductin
.Item.To = destiny
.Item.subject = subject
.Item.Send
End With
[D1].Select
End Function
I have this other way, but I can not send range in the body of email D:
Function Enviar_dados_celulas_email(subject As String, destiny As String, body As Range, introduction As String)
Dim oOutlookApp As Object, oOutlookMessage As Object
Set oOutlookApp = CreateObject("Outlook.Application")
Set oOutlookMessage = oOutlookApp.CreateItem(0)
With oOutlookMessage
.subject = subject
.To = destiny
.body = body
.Display
SendKeys "%e"
End With
Set objMsg = Nothing
End Function
Hello. Enter the code you are using to send the emails on the question so we can help you.
– Omni
Someone???????????????
– Raphael Araujo
This code didn’t help much. You just put the Send Emails function, we need to know how you’re using the sub function, a functional example.
– dHEKU
sub qualquer enviar_email = Enviar_dados_celulas_email("any subject", [email protected], Range("A1:I17"), "follows example") end sub
– Raphael Araujo
this hard t D:
– Raphael Araujo
someone by Please
– Raphael Araujo