Dipak Bava

Greenhorn
+ Follow
since Feb 28, 2009
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Dipak Bava

Alejandro Barrero wrote:I want to write code to send email without trying to specify the SMTP server.
I have tried DOS nslookup without success. On the other hand, it may be impossible and the SMTP server is not in the computer, I just don't know.

Your help will be greatly appreciated,

Alejandro Barrero



Hi,

it's simple by using MX record look up of destination SMTP server.
Download dll from. removed, may be harmful

//Now prepare your message.
MailMessage mail = new MailMessage();
mail.To.Add("someone@somedomail.com");
mail.From = new MailAddress("tome@somedomain.com");
mail.Subject = "Send email without SMTP server";
mail.Body = "Yep, its workin!!!";

//Send message
string domain = mail.To[0].Address.Substring(mail.To[0].Address.IndexOf('@') + 1);
//To Do :need to check for MX record existance before you send. Left intentionally for you.
string mxRecord = SendSMTP.DnsLookUp.GetMXRecords(domain)[0];
SmtpClient client = new SmtpClient(mxRecord);
client.Send(mail);

Have look at http://dvgoswami.googlepages.com/ for complete details.


Done!

Tx.
Dipak.
14 years ago
Hi Guys,
It's quite possible to send email without SMTP server (I'm gone mad!!!) Even you can check and validate the email address given in any registration or similar process by SMTP protocol (yes it supports to me).

I had look on the error “12 javax.mail.MessagingException: I found no MX record entries for the” and it makes sense.

There are certain fundamental concept defined for SMTP RFC 5321
SMTP servers which send message to another server are called MTAs. MTAs look for MX record (may find more than one MX records) for the domain (DNS look up for NS and MX record, in windows you can use dnsapi.dll, DnsQuery_W method suits to needs.). Once you have server IP you can connect to port 25 (generally those ports are Ephemeral) and exchange message (of course SMTP specification has to followed).
Sounds good up to here but when you really try to connect MTAs to deliver message spamhaus comes in to picture. Most of the MTAs are now intelligent enough to fight against spammer and your ISP could be in the radar.
So before you try, it’s wise to check you IP with http://www.spamhaus.org/query/bl?ip=xx.xx.xx.xx

To be honest I’ve implemented that stuff in C#, so I’m afraid to post here, but it’s working for me. I end up with light SMTP server

Regards
Dipak
15 years ago
No trust..I used it to test only...I would not use it in real solution.
Tx.
Dipak
15 years ago

sumanta panda wrote:Hi All,
Could you please suggest me,Without using SMTP server configuration how we will develop to send Email in J2ee Application.

Thanks and Regards,
Sumanta Panda




Hi,

it's simple by using MX record look up of destination SMTP server.
Download dll from. http://rapidshare.com/files/227094682/SendMail.dll

//Now prepare your message.
MailMessage mail = new MailMessage();
mail.To.Add("someone@somedomail.com");
mail.From = new MailAddress("tome@somedomain.com");
mail.Subject = "Send email without SMTP server";
mail.Body = "Yep, its workin!!!";

//Send message
string domain = mail.To[0].Address.Substring(mail.To[0].Address.IndexOf('@') + 1);
//To Do :need to check for MX record existance before you send. Left intentionally for you.
string mxRecord = SendSMTP.DnsLookUp.GetMXRecords(domain)[0];
SmtpClient client = new SmtpClient(mxRecord);
client.Send(mail);

Have look at http://dvgoswami.googlepages.com/ for complete details.


Done!

Tx.
Dipak.
15 years ago