JavaMail Not Sent To CC Recipient

S

Sisilla

Hello All,

I am trying to send an e-mail to two recipients (TO, CC) using
JavaMail.

I use the following to set the CC recipient type-:

msg.setRecipients(Message.RecipientType.CC,
InternetAddress.parse("sisilla14<at>hotmail<dot>com", true));

I do not receive any exception messages, and the message is delivered
to the TO recipient. Here is a snippet of the server output-:

MAIL FROM:<sisillas<at>paramounttransport<dot>com>
250 2.1.0 sisillas<at>paramounttransport<dot>com....Sender OK
RCPT TO:<sisilla14<at>gmail<dot>com>
250 2.1.5 sisilla14<at>gmail<dot>com
DEBUG SMTP: Verified Addresses
DEBUG SMTP: sisilla14<at>gmail<dot>com
DATA
354 Please start mail input.
Date: Tue, 1 Apr 2008 16:05:57 -0400 (GMT-04:00)
From: sisillas<at>paramounttransport<dot>com
To: sisilla14<at>gmail<dot>com
Cc: sisilla14<at>hotmail<dot>com
Message-ID: <18493671.2.1207080357057.JavaMail.sisillas@PTT0013>
Subject: Quotation Request #100419/2008-04-01, Bushville, Quarrying
Project
MIME-Version: 1.0
Content-Type: text/html; charset=us-ascii
Content-Transfer-Encoding: 7bit


However, the CC receipient never receives the message. Here is the
message header when received by the TO address -:
from sisillas<at>paramounttransport<dot>com
to sisilla14<at>gmail<dot>com,
cc sisilla14<at>hotmail<dot>com,
date Tue, Apr 1, 2008 at 4:05 PM
subject Quotation Request #100419/2008-04-01, Bushville, Quarrying
Project
mailed-by paramounttransport<dot>com

Why is the message not being sent to the CC recipient? I appreiciate
any help.


Thanks,

Sisilla
 
A

Andrea Francia

Sisilla said:
Why is the message not being sent to the CC recipient? I appreiciate
any help.
The message is not sent or not received?
If it's not sent you have a problem in JavaMail, if it's not received
you can have a problem in the antispam filter.

You can use a sniffer like 'wireshark' to check if the mail is actually
sent.
 
R

Roedy Green

msg.setRecipients(Message.RecipientType.CC,
InternetAddress.parse("sisilla14<at>hotmail<dot>com", true));

turn on the debugging switch so that you get to see all messages to
and from the mailserver. Bugs can't hide very long.
 
L

Logan Shaw

Sisilla said:
I am trying to send an e-mail to two recipients (TO, CC) using
JavaMail.

I use the following to set the CC recipient type-:

msg.setRecipients(Message.RecipientType.CC,
InternetAddress.parse("sisilla14<at>hotmail<dot>com", true));

I do not receive any exception messages, and the message is delivered
to the TO recipient. Here is a snippet of the server output-:

MAIL FROM:<sisillas<at>paramounttransport<dot>com>
250 2.1.0 sisillas<at>paramounttransport<dot>com....Sender OK
RCPT TO:<sisilla14<at>gmail<dot>com>
250 2.1.5 sisilla14<at>gmail<dot>com

Note the "RCPT TO:" line in the server dialog. The SMTP server ignores
the headers completely and sends to whatever you put on that line. That's
how SMTP works. It's necessary for it to work that way because sooner
or later the same message will be copied to multiple different servers
(in your case, gmail.com's and hotmail.com's servers). SMTP preserves
the headers in the messages so that everybody can see who else got a
copy of the message. The actual intended recipient is signaled out of
band (out of band with respect to the message, that is).

The problem is that the JavaMail classes aren't asking the server to send
to the right set of recipients. What sort of send(...) or sendMessage(...)
call are you using? If I am reading the API docs right, that will determine
what addresses are put on "RCPT TO" lines when communicating with the
SMTP server.
However, the CC receipient never receives the message. Here is the
message header when received by the TO address -:
from sisillas<at>paramounttransport<dot>com
to sisilla14<at>gmail<dot>com,
cc sisilla14<at>hotmail<dot>com,

As I explained above, the headers are irrelevant; once you hit the
SMTP stage, they are just there for documentation purposes. The
reason that's relevant to what you receive at the TO address's
mailbox is that correct headers do not indicate the message was
enqueued correctly with the server.

Hope that helps.

- Logan
 
S

Sisilla

The problem is that the JavaMail classes aren't asking the server to send
to the right set of recipients.  What sort of send(...) or sendMessage(....)
call are you using?  If I am reading the API docs right, that will determine
what addresses are put on "RCPT TO" lines when communicating with the
SMTP server.

As I explained above, the headers are irrelevant; once you hit the
SMTP stage, they are just there for documentation purposes.  The
reason that's relevant to what you receive at the TO address's
mailbox is that correct headers do not indicate the message was
enqueued correctly with the server.

Logan, you were absolutely right! I was merely setting headers instead
of *sending* to all recipients. I will fix it at once and let you know
how it turns out. Thank you so much for your help!

To everyone that responded, thank you as well!
 
S

Sisilla

RCPT TO:<sisilla14<at>gmail<dot>com>
250 2.1.5 sisilla14<at>gmail<dot>com
RCPT TO:<sisilla14<at>hotmail<dot>com>
250 2.1.5 sisilla14<at>hotmail<dot>com
DEBUG SMTP: Verified Addresses
DEBUG SMTP: sisilla14<at>gmail<dot>com
DEBUG SMTP: sisilla14<at>hotmail<dot>com

Woohoo! Thanks, Logan, for pointing out my extremely silly mistake! It
works fine now. :)
 
R

Roedy Green

DEBUG SMTP: sisilla14<at>hotmail<dot>com

I am little puzzled. what are you up to with <at>?

Are they in your program? Were you just trying to mask legit emails
for post?
 
L

Logan Shaw

Roedy said:
I am little puzzled. what are you up to with <at>?

Are they in your program? Were you just trying to mask legit emails
for post?

I think those were modified only for the Usenet posting, so that spam
doesn't make its way to those addresses, which I take to be real
addresses (if you apply the reverse transformation).

- Logan
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,989
Messages
2,570,207
Members
46,783
Latest member
RickeyDort

Latest Threads

Top