delphi programming forums mysql charset mget recursive synonimos
free ventrilo servers hosting cs javascript delay python find in list
Back Forum New
abstract:

, as you can see the above command simply dumps whatever is in file_containig_body_of_email.txt file in the message body of the email, obviously, I can't simply put the HTML formatted message in the
file_containig_body_of_email.txt.
Is there an alternative way of doing this using only mailx and/or sendmail ?


I'm trying to send an email with a file attachment from a Solaris 9 box using the follwoing:
Code:
  1. (/usr/bin/cat file_containig_body_of_email.txt; /usr/bin/uuencode file1.txt file1.txt) | /usr/bin/mailx -c  "address1@domain.com" -s "This is a test" "address2@domain.com" "address2@domain.com"
Copy Code
Where file_containig_body_of_email.txt contains the body of the email, example
This is the body of the email
The above works for emails where the body of the email is in plain text, however I would like to send the body of the email (with file attachment) formatted using HTML., as you can see the above command simply dumps whatever is in file_containig_body_of_email.txt file in the message body of the email, obviously, I can't simply put the HTML formatted message in the
file_containig_body_of_email.txt
.
Is there an alternative way of doing this using only mailx and/or sendmail ?

TOP

You're going to have to learn how to create a multi part email.  You can't just send HTML without a "wrapper" around it.
Can you run Java programs?  I've got a small Java client to do exactly what you want.  You pass it a plain text and an HTML file and it sends them both.  Traditionally you'll want to send both plain text and HTML in case the receiver can't read HTML mail.

TOP


Originally Posted by stdunbar
You're going to have to learn how to create a multi part email.  You can't just send HTML without a "wrapper" around it.
Can you run Java programs?  I've got a small Java client to do exactly what you want.  You pass it a plain text and an HTML file and it sends them both.  Traditionally you'll want to send both plain text and HTML in case the receiver can't read HTML mail.
You mean like this:
Sending files as email attachments

It just doesn't work, it's either I can send the attachment or the body of the email, not both...
I tried this:
Code:
  1. MIME-Version: 1.0
  2. From: address_1@domain.com
  3. To: address_2@domain.com
  4. Cc: address_3@domain.com
  5. Subject: Hello World TEST
  6. Content-Type: multipart/mixed; boundary=NextPart_000
  7. Content-Transfer-Encoding: 7bit
  8. --NextPart_000
  9. Content-Type: text/html
  10. <font size=+1 color=red>
  11.         Hello World
  12. </font>
Copy Code
I execute the following:
/usr/lib/sendmail -t < test.txt
With the above execution the email is sent to the addresses in HTML format, how do I get it to also send a file attachment?



, as you can see the above command simply dumps whatever is in file_containig_body_of_email.txt file in the message body of the email, obviously, I can't simply put the HTML formatted message in the
file_containig_body_of_email.txt.
Is there an alternative way of doing this using only mailx and/or sendmail ?

TOP

Back Forum