MathGroup Archive 2009

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: can SendMail use HTML and embedded images

  • To: mathgroup at smc.vnet.net
  • Subject: [mg100329] Re: can SendMail use HTML and embedded images
  • From: Helen Read <hpr at together.net>
  • Date: Mon, 1 Jun 2009 07:07:51 -0400 (EDT)
  • References: <gvtma4$g9t$1@smc.vnet.net>
  • Reply-to: HPR <read at math.uvm.edu>

Luc Barthelet wrote:
> A nice new feature of v7 is SendMail.
> I use Mathematica to run hourly/daily stats on my web servers, and I 
> started to use SendMail to send the stats.
> 
> I searched the documentation at length, but I have not figured out how 
> to send the email with an HTML and embedded images.
> 
> Has anyone looked into this?
> 
> I believe html in emails can use a <img src="cid:contentId"; format. As 
> for the email, the "content-type" needs to be set to text/html, it would 
> be nice if that was an option (I suspect there is a way to do it, I just 
> have not figured it out). Maybe even detect <html at the beginning ?

Why not send plaintext e-mail with the images as attachments?

I love SendMail, while we're on the subject. I've been using it to mail 
back my students' Mathematica assignments. The notebooks that they 
submit include the student's UVM NetID in the filename, which is used as 
their e-mail username, so it's quite simple to do this. I just wrote a 
little function that does a StringSplit to grab the NetID, constructs 
the e-mail address, and then uses SendMail to send the file in question 
to that address (as an attachment) along with some canned text ("Here is 
your graded lab" etc.). Just Map the function across the list of 
FileNames for the directory where the students' work is located, and 
there you go. It's rather *slow* to send back say 70 of them at a time, 
but it's easy as can be. I just start it up and do something else while 
it cranks away at them.

-- 
Helen Read
University of Vermont


  • Prev by Date: Re: problem writing debugging utility function
  • Next by Date: Re: comments on Wolfram Alpha
  • Previous by thread: Re: Re: problem writing debugging utility function
  • Next by thread: Re: matching misspelled names