Solved

How to send though SMTP with Attachment ?

Posted on 2000-04-12
9
364 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: 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
Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

 
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

PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

Question has a verified solution.

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

Suggested Solutions

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 …
Having just graduated from college and entered the workforce, I don’t find myself always using the tools and programs I grew accustomed to over the past four years. However, there is one program I continually find myself reverting back to…R.   So …
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

730 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