Exception even if one email address is wrong

View: New views
3 Messages — Rating Filter:   Alert me  

Exception even if one email address is wrong

by Devesh Pradhan :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi,

I am using Transport.send(msg) to send mail. I have correct address in TO
List but may get invalid email ids in the CC mail id. Java Mail API is not
sending the mail even to the TO recipient incase of wrong CC mail id.
Is it normal behaviour of Java Mail API or there is a way to tweak it in a
manner so that atleast mail goes to the valid addresses atleaset.

Regards,
Devesh

===========================================================================
To unsubscribe, send email to listserv@... and include in the body
of the message "signoff JAVAMAIL-INTEREST".  For general help, send email to
listserv@... and include in the body of the message "help".

Re: Exception even if one email address is wrong

by Bill Shannon :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Devesh Pradhan wrote:
> Hi,
>
> I am using Transport.send(msg) to send mail. I have correct address in TO
> List but may get invalid email ids in the CC mail id. Java Mail API is not
> sending the mail even to the TO recipient incase of wrong CC mail id.
> Is it normal behaviour of Java Mail API or there is a way to tweak it in a
> manner so that atleast mail goes to the valid addresses atleaset.

Yes, that's normal.  If one of the addresses has been typed incorrectly,
the user might want the chance to correct the typing error before really
sending the message.

If that's not what you want to do, there's a property you can set to tell
it to send the message even if some of the addresses are invalid.  See the
javadocs for the com.sun.mail.smtp package.

===========================================================================
To unsubscribe, send email to listserv@... and include in the body
of the message "signoff JAVAMAIL-INTEREST".  For general help, send email to
listserv@... and include in the body of the message "help".

Re: Exception even if one email address is wrong

by Devesh Pradhan :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi,

When we create object of InternetAddress then itself there is a kind of validation on Email Ids( like space or invalid domain).

If we are using InternetAddress , then do we need to use sendPartial property since we would have caught the exception much earlier then calling the send function. Is there any kind of exception that may not be caught  by InternetAddress constructor.

Please refer to me for any link if you feel my observation is invalid. Thanks for time.


Regards,
Devesh


--- On Wed, 12/24/08, Bill Shannon <bill.shannon@...> wrote:

> From: Bill Shannon <bill.shannon@...>
> Subject: Re: Exception even if one email address is wrong
> To: JAVAMAIL-INTEREST@...
> Date: Wednesday, December 24, 2008, 5:56 AM
> Devesh Pradhan wrote:
> > Hi,
> >
> > I am using Transport.send(msg) to send mail. I have
> correct address in TO
> > List but may get invalid email ids in the CC mail id.
> Java Mail API is not
> > sending the mail even to the TO recipient incase of
> wrong CC mail id. Is it normal behaviour of Java Mail API or
> there is a way to tweak it in a
> > manner so that atleast mail goes to the valid
> addresses atleaset.
>
> Yes, that's normal.  If one of the addresses has been
> typed incorrectly,
> the user might want the chance to correct the typing error
> before really
> sending the message.
>
> If that's not what you want to do, there's a
> property you can set to tell
> it to send the message even if some of the addresses are
> invalid.  See the
> javadocs for the com.sun.mail.smtp package.
>
> ===========================================================================
> To unsubscribe, send email to listserv@... and
> include in the body
> of the message "signoff JAVAMAIL-INTEREST".  For
> general help, send email to
> listserv@... and include in the body of the
> message "help".


     

===========================================================================
To unsubscribe, send email to listserv@... and include in the body
of the message "signoff JAVAMAIL-INTEREST".  For general help, send email to
listserv@... and include in the body of the message "help".