Jump to content
Fórum Script Brasil
  • 0

Anexar E-mail Usando Vbs (wsh)


Guest Cruzfs
 Share

Question

Galera....Estou precisando de uma ajuda :(

Tenho o código abaixo já funcionando, porem não consegui enviar e-mail com anexo,

somente e-mail simples:

'Body of email message

Dim msgBody

msgBody="Teste de e-mail via script, só falta anexar o arquivo 8( "

'Call our function with recipient, message and subject

MySendMail "[email protected]",msgBody,"Automated Message."

Sub MySendMail(recipient,msg,subject)

Dim objSession, oInbox, colMessages, oMessage, oAttachment, colRecipients

Set objSession = CreateObject("MAPI.Session")

objSession.Logon "Outlook"

Set oInbox = objSession.Inbox

Set colMessages = oInbox.Messages

Set oMessage = colMessages.Add()

Set colRecipients = oMessage.Recipients

colRecipients.Add recipient

colRecipients.Resolve

oMessage.Subject = subject

oMessage.Text = msg

oMessage.Send

objSession.Logoff

Set objSession = nothing

End Sub

Já tentei criar um Objeto para anexar, mas não funcionou

alguém tem ideia de como fazer????? :rolleyes:

Grato pela atençao e Abraços..... B)

Link to comment
Share on other sites

1 answer to this question

Recommended Posts

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share



  • Forum Statistics

    • Total Topics
      151k
    • Total Posts
      649.1k
×
×
  • Create New...