Solved

How to send though SMTP with Attachment ?

Posted on 2000-04-12
9
361 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
ID: 2706866
0
 
LVL 28

Expert Comment

by:AzraSound
ID: 2706871
sorry didnt read your question closely enough
0
 
LVL 2

Expert Comment

by:gelog
ID: 2706890
0
DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

 
LVL 1

Expert Comment

by:detiege
ID: 2707283
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
 

Author Comment

by:amrufon
ID: 2707457
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
ID: 2708361
0
 
LVL 9

Accepted Solution

by:
Ruchi earned 200 total points
ID: 2708372
0
 
LVL 1

Expert Comment

by:adam8
ID: 2709923
0
 

Author Comment

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

Featured Post

Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
This tutorial explains how to use the VisualVM tool for the Java platform application. This video goes into detail on the Threads, Sampler, and Profiler tabs.
The viewer will learn how to user default arguments when defining functions. This method of defining functions will be contrasted with the non-default-argument of defining functions.

777 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