Solved

SMTP with telnet and attchement?

Posted on 2003-12-02
10
6,686 Views
Last Modified: 2007-11-27
i am a beginer.How can i send email by telnet and i want to attach files too when sending emails, can you tell me how can do this? Will you please suggest some softwares for sending emails with attachements by telnet?
0
Comment
Question by:baburkhan
[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
  • 4
  • 3
  • 2
  • +1
10 Comments
 
LVL 8

Expert Comment

by:JasonBigham
ID: 9859973
What is your mail server environement? UNIX, then the old standard PINE would fit your needs.
0
 

Author Comment

by:baburkhan
ID: 9861522
it is windows 98 and XP not unix. ummm let me tell you in detail i have an attachment, want to send it by telnet having features like i can write a message and change any data or things.so can you tell me any good software for that or should i write telnet commands in a text and pipe them through netcat, but i dont know the procedure to attach the file (i know sending email messages by telnet at beginners level).
0
 
LVL 8

Expert Comment

by:waybadmojo
ID: 9862971
SMTP mail commands (telnet via port 25)

    helo
    mail from:<sender@sendercompany.com>
    rcpt to:<user@recipientcompany.com>
    data
    From: "Bubba Joe" <bubba@sendercompany.com>
    To: <user@recipientcompany.com>
    Subject: Message Text Here
    "Message body"
    .
    quit


In order to send attachments via telnet you would have to include the base64 text of your attachment after the subject and prior to the . on a line by itself but this would not be pretty. For example, a small JPEG image might look like this inserted:

Content-Type: image/jpeg; name="image001.jpg"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="image001.jpg"
-- lines of base64 encoded image here
-- lines of base64 encoded image here
-- lines of base64 encoded image here
-- lines of base64 encoded image here
-- lines of base64 encoded image here
-- lines of base64 encoded image here
-- lines of base64 encoded image here
-- lines of base64 encoded image here
-- lines of base64 encoded image here
-- lines of base64 encoded image here

These lines will continue for the length of the attachment, not pretty.

Hope this helps.
0
MS Dynamics Made Instantly Simpler

Make Your Microsoft Dynamics Investment Count  & Drastically Decrease Training Time by Providing Intuitive Step-By-Step WalkThru Tutorials.

 

Author Comment

by:baburkhan
ID: 9865917
thanks but i want to know more about it. how can i encode my attachement in base64 , i tried to use mpack.exe to do so but i am not familiar with it , moreover can you tell me any software for this which asks me things, connect to telnel itself and send the email.
0
 
LVL 37

Expert Comment

by:bbao
ID: 9879878
.exe? baburkhan, what do you want to do? to send junk mails or learn for writing your own email client... ;-))
0
 
LVL 37

Expert Comment

by:bbao
ID: 9879897
well, if you dont want to know about base64 encoding in detail, just want to learn a way to send your attachment with telnet, i can show you a method i did successfully.
0
 

Author Comment

by:baburkhan
ID: 9882773
i want to make my own email client , mpack.exe i used to encode attachements in base64, but i dont know how to use this. well i can send emails without attachement now but please help me more with attachements , thanks.
0
 
LVL 37

Expert Comment

by:bbao
ID: 9882892
just forget mpack.exe if you dont know how to use it. following my instructions, you can easily get the encoded text of your specific file with well-known email client - Outlook Express.

write a simple or even empty email with the file you want to attach in OE6, save it into the draft folder, save the message to a .eml file, then use notepad to open this .eml file, you may see the encoded attachment is already there, merge it with other parts of email you already edited.

as for understanding base64 encoding, refer the following:

How Base64 Encoding Works
http://email.about.com/cs/standards/a/base64_encoding.htm

hope it helps,
bbao
0
 
LVL 8

Accepted Solution

by:
waybadmojo earned 105 total points
ID: 9894967
Using mpack should be fairly straightforward:

The program is activated with:

      mpack [options] -o outputfile inputfile

The most common options are:

     -s subject
         
     -d descriptionfile
          Include the contents of the file description in an
          introductory section at the beginning of the first
          generated message.

     -c content-type
          Label the included file as being of MIME type
          content-type, which must be a subtype of application,
          audio, image, or video.

     -o outputfile
          Write the generated message to the file outputfile.

For example, to create a mail-ready message with subject of "Test Message" and the attachment program.exe Base-64 encoded in the contents, use the command line:

mpack -s "Test Message" -d message.txt -c application -o program.b64 program.exe

Afterwards, you will have a file named program.b64 which looks like the following:

Message-ID: <??????????@unknownpc>
Mime-Version: 1.0
Subject: Test Message
Content-Type: multipart/mixed; boundary="-"

This is a MIME encoded message.  Decode it with "munpack"
or any other MIME reading software.  Mpack/munpack is available
via anonymous FTP in ftp.andrew.cmu.edu:pub/mpack/
---

The contents of the file message.txt will be inserted here

---
Content-Type: application/octet-stream; name="program.exe"
Content-Transfer-Encoding: base64
Content-Disposition: inline; filename="program.exe"
Content-MD5: <Base64 encoding of Program.exe will be inserted here>

Hope this helps, and please use your newfound SMTP superpowers only for good!
0
 
LVL 37

Expert Comment

by:bbao
ID: 10054369
baburkhan, any feedback please?
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Email signatures have numerous marketing benefits. Here are 8 top reasons to turn your email signature into a marketing channel.
Article by: Dermot
The life of crime is over for 22 year-old Christian Ian Salvador, a student from Isabela State University in the Philippines.
The purpose of this video is to demonstrate how to set up a Mailchimp campaign. This will include styling and adding elements to a newsletter/email. This will be demonstrated using a Windows 8 PC. Mailchimp will be used. Log into your Mailchim…
Many of my clients call in with monstrous Gmail overloading issues with Outlook. A quick tip is to turn off the All Mail and Important folders from synching. Here is a quick video I made to show you how to turn off these and other folders in Gmail s…

749 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