From: Mohit Sindhwani Date: 2008-02-17T17:00:39+09:00 Subject: Re: smtp - from field shows up blank in client Dan Zwell wrote: > Max Payne wrote: >> Hello, >> I'm using the following code which is working fine except the from >> address comes up blank. >> >> smtp = Net::SMTP.start('smtp.mydomain.com', 587, 'mydomain.com', >> 'username@mydomain.com', 'password', :login) { |smtp| >> smtp.send_message( msg, 'from@mydomain.com', >> ['towhoever@gmail.com'] ) >> } >> The email goes out but it doesn't tell me who it's from. >> In gmail the from is (Unknown Sender), In yahoo or others it's blank. >> What am I missing? >> >> > > Hello Max, > > I think the from/to/subject needs to be part of your message, like this: > msg = < From: Me > To: You > Subject: This email is a test. > > This is the start of the message body... > EOF > > Good luck, > Dan > Also, if you're missing the date, you'll need to add that in. Check out the example on my page here: http://notepad.onghu.com/2007/3/26/sending-email-with-ruby Cheers, Mohit. 2/17/2008 | 4:00 PM.