[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

smtp - from field shows up blank in client

Max Payne

2/17/2008 7:06:00 AM

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?
12 Answers

Dan Zwell

2/17/2008 7:27:00 AM

0

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 = <<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

Mohit Sindhwani

2/17/2008 8:01:00 AM

0

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 = <<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. Check out
the example on my page here:
http://notepad.onghu.com/2007/3/26/sending-email...

Cheers,
Mohit.
2/17/2008 | 4:00 PM.



Max Payne

2/17/2008 3:15:00 PM

0

On Feb 17, 3:00 am, 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 = Net::SMTP.start('smtp.mydomain.com', 587, 'mydomain.com',
> >> 'usern...@mydomain.com', 'password', :login) { |smtp|
> >>   smtp.send_message( msg,  '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 = <<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.  Check out
> the example on my page here:http://notepad.onghu.com/2007/3/26/sending-email...
>
> 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...

Mohit Sindhwani

2/17/2008 4:02:00 PM

0

Max Payne wrote:
> On Feb 17, 3:00 am, Mohit Sindhwani <mo_m...@onghu.com> wrote:
>
>> 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...
>>
>
> 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...
>

Hi Max

I've never tried CC, so I don't know. But, if you do get it, please
post here for future reference - I'll also update the example on my page
after that.

Cheers,
Mohit.
2/18/2008 | 12:02 AM.




Max Payne

2/17/2008 5:23:00 PM

0

On Feb 17, 11:01 am, Mohit Sindhwani <mo_m...@onghu.com> wrote:
> Max Payne wrote:
> > On Feb 17, 3:00 am, Mohit Sindhwani <mo_m...@onghu.com> wrote:
>
> >> 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...
>
> > 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...
>
> Hi Max
>
> I've never tried CC, so I don't know.  But, if you do get it, please
> post here for future reference - I'll also update the example on my page
> after that.
>
> Cheers,
> Mohit.
> 2/18/2008 | 12:02 AM.

I added a cc_mail var and an extra parameter for send_message and it
worked although I didn't completely test. I received a [You were Cc'd]
message on my blackberry so I'm thrilled. If I had more cc's then I
would have used an array of email addresses.

cc_mail = 'to@ccemail.com'

msg = <<EOF
From: #{from_name}<#{from_mail}>
To: #{to_name}<#{to_mail}>
Cc: #{cc_mail}
Subject: E&D upload complete.

#{body}
Powered By Ruby
EOF

smtp = Net::SMTP.start(smtp_host, smtp_port, smtp_domain, smtp_user,
smtp_password, :login) { |smtp|
smtp.send_message(msg,smtp_user,to_mail,cc_mail)
}

Sid9

1/4/2013 10:58:00 PM

0


"John" <johnwayne@oldwest.net> wrote in message
news:LLadnTgzfZ2wsnrNnZ2dnUVZ_t2dnZ2d@earthlink.com...
> Jane Galt wrote:
>> http://www.theblaze.com/stories/boston-mayor-says-biden-guaranteed-...
>> will-pass-major-gun-control-reform-by-end-of-janua
>>
>> Just how might the Commie in Chief, "President Mordred" do this without
>> the House vote? Is he planning on dictating it through an executive
>> order? Can a President order something unconstitutional? Is it even legal
>> if he does?
>
> The Filthy son of a bitch should be impeached and imprisoned.
.
.

You are nuts!
You have nothing on Obama...you just hate him and you don't know why.

Sid9

1/4/2013 11:00:00 PM

0


"John" <johnwayne@oldwest.net> wrote in message
news:LLadnTgzfZ2wsnrNnZ2dnUVZ_t2dnZ2d@earthlink.com...
> Jane Galt wrote:
>> http://www.theblaze.com/stories/boston-mayor-says-biden-guaranteed-...
>> will-pass-major-gun-control-reform-by-end-of-janua
>>
>> Just how might the Commie in Chief, "President Mordred" do this without
>> the House vote? Is he planning on dictating it through an executive
>> order? Can a President order something unconstitutional? Is it even legal
>> if he does?
>
> The Filthy son of a bitch should be impeached and imprisoned.

I understand Russia is accepting immigrants...You might consider moving.
We'll miss you

100 Million Dead

1/4/2013 11:31:00 PM

0

John <johnwayne@oldwest.net> wrote :

> Jane Galt wrote:
>> http://www.theblaze.com/stories/boston-mayor-says-biden-guaran...
>> bama- will-pass-major-gun-control-reform-by-end-of-janua
>>
>> Just how might the Commie in Chief, "President Mordred" do this without
>> the House vote? Is he planning on dictating it through an executive
>> order? Can a President order something unconstitutional? Is it even
>> legal if he does?
>>
>>
>
> The Filthy son of a bitch should be impeached and imprisoned.
>

And deported! He wasn't born here!


--
- 100 Million Dead
In the last century, from various forms of socialism!

Sid9

1/5/2013 12:06:00 AM

0


"100 Million Dead" <100MillionDead@DeadMillions.Nix> wrote in message
news:k4KdnaKEcrm--3rNnZ2dnUVZ5h-dnZ2d@giganews.com...
> John <johnwayne@oldwest.net> wrote :
>
>> Jane Galt wrote:
>>> http://www.theblaze.com/stories/boston-mayor-says-biden-guaran...
>>> bama- will-pass-major-gun-control-reform-by-end-of-janua
>>>
>>> Just how might the Commie in Chief, "President Mordred" do this without
>>> the House vote? Is he planning on dictating it through an executive
>>> order? Can a President order something unconstitutional? Is it even
>>> legal if he does?
>>>
>>>
>>
>> The Filthy son of a bitch should be impeached and imprisoned.
>>
>
> And deported! He wasn't born here!
>
>
> --
> - 100 Million Dead
> In the last century, from various forms of socialism!
.
.

....and what would your say if he did some of the asshole stunts bush,jr did?


Jan Panteltje

1/5/2013 10:10:00 AM

0

On a sunny day (Fri, 4 Jan 2013 18:00:19 -0500) it happened "Sid9" <sid9@
bellsouth.net> wrote in <kc7mui$tkb$1@dont-email.me>:

>
>"John" <johnwayne@oldwest.net> wrote in message
>news:LLadnTgzfZ2wsnrNnZ2dnUVZ_t2dnZ2d@earthlink.com...
>> Jane Galt wrote:
>>> http://www.theblaze.com/stories/boston-mayor-says-biden-guaranteed-...
>>> will-pass-major-gun-control-reform-by-end-of-janua
>>>
>>> Just how might the Commie in Chief, "President Mordred" do this without
>>> the House vote? Is he planning on dictating it through an executive
>>> order? Can a President order something unconstitutional? Is it even legal
>>> if he does?
>>
>> The Filthy son of a bitch should be impeached and imprisoned.
>
>I understand Russia is accepting immigrants...You might consider moving.
>We'll miss you

I have read taxes are only 15% for EVERYONE in Russia.
There are a lot of Russian millionaires.
When all the cunning rich people have moved there,
then the remaining dumbos will live in the Somalia of N. America,
ruled by various war lords.

As to disarming people,
reminds me of Germany before WW2,
then the Jews could be round up without any resistance.

OTOH when people will be able to get their own personal nukes,
collateral damage from one idiot will extend city wide.

So maybe there IS a balance somewhere.

No immediate solution from me,
but I will watch the fireworks.
either way!
?
LOL