[WnCC] Automated smtp email using smtp-auth.iitb.ac.in:25

43 views
Skip to first unread message

Sourabh Bhat

unread,
Apr 12, 2015, 5:56:57 PM4/12/15
to wncc...@googlegroups.com
I am unable to send mails by using a code through iitb smtp. Has anyone tried sending automated emails using LDAP mail id from inside IITB?

I just tried using Java and Python libraries for this but the server (smtp-auth.iitb.ac.in) does not send my mails. It responds with:
MTPAddressFailedException: 454 4.7.1 <bhat.s...@iitb.ac.in>: Relay access denied.

I am able to however use gpo from webpage for sending msgs. Can someone tell me what is going wrong? I am attaching here the Python and Java codes which I have tried.

--
Best Regards,
-- Sourabh
Testing.java
testing.py

Dilawar Singh

unread,
Apr 25, 2015, 3:20:16 PM4/25/15
to wncc...@googlegroups.com

Dheerendra Rathor

unread,
Apr 26, 2015, 1:01:32 AM4/26/15
to wncc...@googlegroups.com
for python,
add following lines after server.starttls()

server.ehlo()
server.esmtp_features['auth'] = 'LOGIN PLAIN'


--
--
The website for the club is http://wncc-iitb.org/
To post to this group, send email to wncc...@googlegroups.com
---
You received this message because you are subscribed to the Google Groups "Web and Coding Club IIT Bombay" group.
To unsubscribe from this group and stop receiving emails from it, send an email to wncc_iitb+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Sourabh Bhat

unread,
Apr 28, 2015, 2:21:37 AM4/28/15
to wncc...@googlegroups.com
Thank you!!

By the time it got posted here, I have long found a solution.

I was able to make it work in Java by adding a property in Session.
props.put("mail.smtp.ssl.trust", "smtp-auth.iitb.ac.in");

Truly speaking I do not understand the details but I found all properties after a while of search at:
https://javamail.java.net/nonav/docs/api/com/sun/mail/smtp/package-summary.html

I have not tested the python code provided by you guys. I believe that it will work as well, but I will continue with my existing Java code as of now.

Thanks,
Sourabh Bhat

 
Reply all
Reply to author
Forward
0 new messages