On Feb 17, 3:00=A0am, Mohit Sindhwani <mo_m... / onghu.com> wrote:
> 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 =3D Net::SMTP.start('smtp.mydomain.com', 587, 'mydomain.com',
> >> 'usern... / mydomain.com', 'password', :login) { |smtp|
> >> =A0 smtp.send_message( msg, =A0'f... / mydomain.com',
> >> ['towhoe... / 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 =3D <<EOF
> > From: Me <my / address>
> > To: You <your / address>
> > 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. =A0Check out=

> the example on my page here:http://notepad.onghu.com/2007/3/26/sending-ema=
il-with-ruby
>
> Cheers,
> Mohit.
> 2/17/2008 | 4:00 PM.- Hide quoted text -
>
> - Show quoted text -

Thanks , putting it all in the message did the trick. Mohit thanks for
the great example. Now I need to figure out how to CC. The
send_message method takes a to and a from...