Solved

SMTP with telnet and attchement?

Posted on 2003-12-02
10
6,509 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
  • 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
 

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:Bing CISM / CISSP
ID: 9879878
.exe? baburkhan, what do you want to do? to send junk mails or learn for writing your own email client... ;-))
0
Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

 
LVL 37

Expert Comment

by:Bing CISM / CISSP
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:Bing CISM / CISSP
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:Bing CISM / CISSP
ID: 10054369
baburkhan, any feedback please?
0

Featured Post

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

If you are anything like me, you install many apps on your phone and have your life on it, sometimes literally.  When I bought my current phone, a Samsung Galaxy S5 from Verizon, they were only selling the versions with 16 GB internal.  I didn't rea…
We are happy to announce a brand new addition to our line of acclaimed email signature management products – CodeTwo Email Signatures for Office 365.
The purpose of this video is to demonstrate how to set up a Mailchimp Template which will let the user create a uniform look for all of their campaigns. This will be demonstrated using a Windows 8 PC. Mailchimp will be used. Log into your Mail…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…

760 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

20 Experts available now in Live!

Get 1:1 Help Now