1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
| Public Sub Send_mail(Obj As String, txt As String, aqui As String, dequi As String)
Dim CdoMessage As CDO.Message
Set CdoMessage = New CDO.Message
Dim oField As Field
With CdoMessage
Set oField = .Fields("http://schemas.microsoft.com/cdo/configuration/smtpserverport")
MsgBox oField
oField.Value = 25
MsgBox oField
' TODO: Replace with your SMTP server.
Set oField = .Fields("http://schemas.microsoft.com/cdo/configuration/smtpserver")
MsgBox oField
oField.Value = "<SMTP Server>"
MsgBox oField
.Subject = Obj
.From = dequi
.To = aqui
.CC = ""
.BCC = ""
.TextBody = txt
.Send
End With
Set CdoMessage = Nothing
End Sub |