Solved

How to send though SMTP with Attachment ?

Posted on 2000-04-12
9
366 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
  • 2
  • +3
9 Comments
 
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
Revamp Your Training Process

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action.

 
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

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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

How to remove superseded packages in windows w60 or w61 installation media (.wim) or online system to prevent unnecessary space. w60 means Windows Vista or Windows Server 2008. w61 means Windows 7 or Windows Server 2008 R2. There are various …
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
The viewer will learn how to clear a vector as well as how to detect empty vectors in C++.
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.

726 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