Hi all,

I am using Java code to send email to users.

The code is

SMTPTransport tr = (SMTPTransport) poSession.getTransport("smtps");
tr.connect(MailHost,FromMailId,Password);
tr.sendMessage(Message,Message.getAllRecipients());

FromMailId is from user mailid

Password is from user password.

Message is what can from user sent to toUser

Message.getAllRecipients() are to user mail id..

But how do i know whether the Email is Successfully Sent or Not?

Ex the User give the Email address as 'xxxx@gamil.com' instead of 'xxxx@gmail.com'

Is any method to identity this problem?

I am waiting for your valuable reply..

Thanks ,

Myl

Could anyone help me to out of this Problem?

Help should be highly appreciated..

Thanks

Myl..

You've got two questions here. I'm not an expert in this area, but I'll take a stab at it. You should certainly do your own research before you take my word for it, though.

First question is, how can I tell whether a send worked. As far as I know, you can't. ISPs generally don't send bounce messages any more, since this simply validates addresses for spammers, and your receiving host simply consumes all packets directed to it, regardless of the local recipient name, so if the host exists, your send will be "successful" in that it'll get to the machine it's pointed at, but you'll never know whether the particular account you addressed your mail to exists or not unless you get a response.

Second question is, can you validate addresses? Yes, to some extent. You can certainly check to see whether "gamil.com" is a domain name that someone's registered, and you might be able to do some sort of spell-checking (easy enough to find fat-fingered variants of the common email providers, right?). You can query name servers about machine names - there are limits to the number of queries, which I think you'l run into pretty fast if you try to query mechanically, but you'll have to explore that for yourself. At the far end of that, checking whether a particular address exists at a particular host is (as I said above) not possible today. Used to be, before they let the rabble and the hoi polloi onto the internet, but those days are gone.

As I say, this is just me talking, and I make no promises as to the corretness of any of it. I think it's pretty close, but what do I know?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.