Solved

How to send though SMTP with Attachment ?

Posted on 2000-04-12
9
359 Views
Last Modified: 2013-11-13
I know how to send mails through SMTP. That is only doing it if Im sending text. How do I do send mail with Attachments like WAV files, Docs and other formats and the reciepient will still be able to decode/read it?
0
Comment
Question by:amrufon
  • 2
  • 2
  • 2
  • +3
9 Comments
 
LVL 28

Expert Comment

by:AzraSound
Comment Utility
0
 
LVL 28

Expert Comment

by:AzraSound
Comment Utility
sorry didnt read your question closely enough
0
 
LVL 2

Expert Comment

by:gelog
Comment Utility
0
 
LVL 1

Expert Comment

by:detiege
Comment Utility
You can try this code to send mail with attachment.
I think that's you want

Private Sub Command1_Click()
 
MAPISession1.SignOn
With MAPIMessages1
..MsgIndex = -1
..RecipDisplayName = "detiege@ceb.be"
' Recipient adress

..MsgSubject = "SUJET" ' Subject
..MsgNoteText = "Line 1" + vbCrLf + "Line 2"
' Message
..SessionID = MAPISession1.SessionID
           
..AttachmentIndex = 0
..AttachmentPathName = "C:\config.sys"
' File Path

..AttachmentPosition =
Len(.MsgNoteText) - 1
..AttachmentType = 0
..ResolveName
           
..AttachmentIndex = 1
..AttachmentPathName =
"C:\config.dos" ' File Path
..AttachmentPosition =
Len(.MsgNoteText) - 1
..AttachmentType = 0
..ResolveName
           
..Send
End With
MAPISession1.SignOff
 
End Sub
0
Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

 

Author Comment

by:amrufon
Comment Utility
Sorry, I have to reject this answer. It may be because the answer was incomplete. What I really need is how to send it WITHOUT USING MAPI.

I actually send the mail using WinSock. The only problem with using that is it treat everything as text. If you try to attach something to your mail and send it, the mail becomes garbage (the attached part that is).

Detigie, there is a bug in your solution. Your code will only work with Outlook Express. If you try using the same code and your MAPI app is Outlook, it would die with error the error "Unspecified Error has occured". To work around this, try padding an extra space after the message text.

Thanks anyway!

<grin>
0
 
LVL 9

Expert Comment

by:Ruchi
Comment Utility
0
 
LVL 9

Accepted Solution

by:
Ruchi earned 200 total points
Comment Utility
0
 
LVL 1

Expert Comment

by:adam8
Comment Utility
0
 

Author Comment

by:amrufon
Comment Utility
Thanks. I'll use the code as my foundation and build from it.
0

Featured Post

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

This article is meant to give a basic understanding of how to use R Sweave as a way to merge LaTeX and R code seamlessly into one presentable document.
This article will show, step by step, how to integrate R code into a R Sweave document
The viewer will learn how to implement Singleton Design Pattern in Java.
This tutorial will introduce the viewer to VisualVM for the Java platform application. This video explains an example program and covers the Overview, Monitor, and Heap Dump tabs.

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now