Alguma ideia de como enviar anexo quando rodo o script abaixo? não conheço o comando, se possivel alguém pode incluir no script e postar?
Obrigado!!
Dim ToAddress
Dim MessageSubject
Dim MessageBody
Dim MessageAttachment
Dim ol, ns, newMail
ToAddress = "teste@teste.com.br" ' You can change this to your email address
MessageSubject = "How to send email with Outlook and Vbscript"
MessageBody = "teste"
Set ol = WScript.CreateObject("Outlook.Application")
Set ns = ol.getNamespace("MAPI")
ns.logon "","",true,false
Set newMail = ol.CreateItem(olMailItem)
newMail.Subject = MessageSubject
newMail.Body = MessageBody & vbCrLf
' To Validate the recipient
' To Validate the recipient
Set myRecipient = ns.CreateRecipient(ToAddress)
myRecipient.Resolve
If Not myRecipient.Resolved Then
MsgBox "Unknown Recipient"
Else
newMail.Recipients.Add(myRecipient)
newMail.Send
End If
Set ol = Nothing
Pergunta
Pjunior055
Boa tarde, Pessoal
Alguma ideia de como enviar anexo quando rodo o script abaixo? não conheço o comando, se possivel alguém pode incluir no script e postar?
Obrigado!!
Dim ToAddress Dim MessageSubject Dim MessageBody Dim MessageAttachment Dim ol, ns, newMail ToAddress = "teste@teste.com.br" ' You can change this to your email address MessageSubject = "How to send email with Outlook and Vbscript" MessageBody = "teste" Set ol = WScript.CreateObject("Outlook.Application") Set ns = ol.getNamespace("MAPI") ns.logon "","",true,false Set newMail = ol.CreateItem(olMailItem) newMail.Subject = MessageSubject newMail.Body = MessageBody & vbCrLf ' To Validate the recipient ' To Validate the recipient Set myRecipient = ns.CreateRecipient(ToAddress) myRecipient.Resolve If Not myRecipient.Resolved Then MsgBox "Unknown Recipient" Else newMail.Recipients.Add(myRecipient) newMail.Send End If Set ol = NothingEditado por kuroiAdicionar tag CODE
Link para o comentário
Compartilhar em outros sites
1 resposta a esta questão
Posts Recomendados
Participe da discussão
Você pode postar agora e se registrar depois. Se você já tem uma conta, acesse agora para postar com sua conta.