spring - Mail not sending using javaMail -
in application sending mail using spring. works fine when sending mail gmail id, when sending smtp server mail not sending. spring configuration gmail:
<beans> <bean id="mailsender" class="org.springframework.mail.javamail.javamailsenderimpl"> <property name="host" value="smtp.gmail.com" /> <property name="port" value="587" /> <property name="username" value="diganta.xxxxx@gmail.com" /> <property name="password" value="******" /> <property name="javamailproperties"> <props> <prop key="mail.smtp.starttls.enable">true</prop> <prop key="mail.smtp.auth">true</prop> </props> </property> </bean> <bean id="requesttoacceptordeny" class="com.edfx.adb.mail.requesttoacceptordeny"> <property name="mailsender" ref="mailsender" /> </bean> </beans>
but when change configuration :
<property name="host" value="mail.mycompany.co.in" /> <property name="port" value="25" /> <property name="username" value="xxx@mycompany.co.in" /> <property name="password" value="abc123" />
then no exception generating, mail not sending, password not checking, ie given password right or not. can't understand have done wrong.
can me? thanks
update-1
16:29:23,524 info [stdout] (http-localhost-127.0.0.1-8080-1) hibernate: select user0_.id id7_0_, user0_.create_timestamp create2_7_0_, user0_.last_update_timestamp last3_7_0_, user0_.version version7_0_, user0_.active active7_0_, user0_.date_of_birth date6_7_0_, user0_.date_of_joining date7_7_0_, user0_.date_of_release date8_7_0_, user0_.first_name first9_7_0_, user0_.full_name full10_7_0_, user0_.home_phone home11_7_0_, user0_.home_postal_address home12_7_0_, user0_.last_name last13_7_0_, user0_.mail mail7_0_, user0_.mobile mobile7_0_, user0_.role role7_0_, user0_.username username7_0_ user user0_ user0_.id=? 16:29:23,534 info [stdout] (http-localhost-127.0.0.1-8080-1) debug: javamail version 1.4.4 16:29:23,534 info [stdout] (http-localhost-127.0.0.1-8080-1) debug: loaded resource: /meta-inf/javamail.default.providers 16:29:23,544 info [stdout] (http-localhost-127.0.0.1-8080-1) debug: tables of loaded providers 16:29:23,544 info [stdout] (http-localhost-127.0.0.1-8080-1) debug: providers listed class name: {com.sun.mail.smtp.smtpssltransport=javax.mail.provider[transport,smtps,com.sun.mail.smtp.smtpssltransport,sun microsystems, inc], com.sun.mail.smtp.smtptransport=javax.mail.provider[transport,smtp,com.sun.mail.smtp.smtptransport,sun microsystems, inc], com.sun.mail.imap.imapsslstore=javax.mail.provider[store,imaps,com.sun.mail.imap.imapsslstore,sun microsystems, inc], com.sun.mail.pop3.pop3sslstore=javax.mail.provider[store,pop3s,com.sun.mail.pop3.pop3sslstore,sun microsystems, inc], com.sun.mail.imap.imapstore=javax.mail.provider[store,imap,com.sun.mail.imap.imapstore,sun microsystems, inc], com.sun.mail.pop3.pop3store=javax.mail.provider[store,pop3,com.sun.mail.pop3.pop3store,sun microsystems, inc]} 16:29:23,544 info [stdout] (http-localhost-127.0.0.1-8080-1) debug: providers listed protocol: {imaps=javax.mail.provider[store,imaps,com.sun.mail.imap.imapsslstore,sun microsystems, inc], imap=javax.mail.provider[store,imap,com.sun.mail.imap.imapstore,sun microsystems, inc], smtps=javax.mail.provider[transport,smtps,com.sun.mail.smtp.smtpssltransport,sun microsystems, inc], pop3=javax.mail.provider[store,pop3,com.sun.mail.pop3.pop3store,sun microsystems, inc], pop3s=javax.mail.provider[store,pop3s,com.sun.mail.pop3.pop3sslstore,sun microsystems, inc], smtp=javax.mail.provider[transport,smtp,com.sun.mail.smtp.smtptransport,sun microsystems, inc]} 16:29:23,544 info [stdout] (http-localhost-127.0.0.1-8080-1) debug: loaded resource: /meta-inf/javamail.default.address.map 16:29:23,594 info [stdout] (http-localhost-127.0.0.1-8080-1) sending email .... 16:29:23,594 info [stdout] (http-localhost-127.0.0.1-8080-1) debug: getprovider() returning javax.mail.provider[transport,smtp,com.sun.mail.smtp.smtptransport,sun microsystems, inc] 16:29:23,604 info [stdout] (http-localhost-127.0.0.1-8080-1) debug smtp: useehlo true, useauth true 16:29:23,604 info [stdout] (http-localhost-127.0.0.1-8080-1) debug smtp: trying connect host "mail.mycompany.co.in", port 25, isssl false 16:29:24,634 info [stdout] (http-localhost-127.0.0.1-8080-1) 220 mail.mycompany.co.in esmtp postfix 16:29:24,644 info [stdout] (http-localhost-127.0.0.1-8080-1) debug smtp: connected host "mail.mycompany.co.in", port: 25 16:29:24,644 info [stdout] (http-localhost-127.0.0.1-8080-1) 16:29:24,644 info [stdout] (http-localhost-127.0.0.1-8080-1) ehlo edfx-desktop-28 16:29:24,865 info [stdout] (http-localhost-127.0.0.1-8080-1) 250-mail.mycompany.co.in 16:29:24,865 info [stdout] (http-localhost-127.0.0.1-8080-1) 250-pipelining 16:29:24,865 info [stdout] (http-localhost-127.0.0.1-8080-1) 250-size 10240000 16:29:24,875 info [stdout] (http-localhost-127.0.0.1-8080-1) 250-vrfy 16:29:24,875 info [stdout] (http-localhost-127.0.0.1-8080-1) 250-etrn 16:29:24,875 info [stdout] (http-localhost-127.0.0.1-8080-1) 250-enhancedstatuscodes 16:29:24,875 info [stdout] (http-localhost-127.0.0.1-8080-1) 250-8bitmime 16:29:24,875 info [stdout] (http-localhost-127.0.0.1-8080-1) 250 dsn 16:29:24,875 info [stdout] (http-localhost-127.0.0.1-8080-1) debug smtp: found extension "pipelining", arg "" 16:29:24,875 info [stdout] (http-localhost-127.0.0.1-8080-1) debug smtp: found extension "size", arg "10240000" 16:29:24,875 info [stdout] (http-localhost-127.0.0.1-8080-1) debug smtp: found extension "vrfy", arg "" 16:29:24,875 info [stdout] (http-localhost-127.0.0.1-8080-1) debug smtp: found extension "etrn", arg "" 16:29:24,875 info [stdout] (http-localhost-127.0.0.1-8080-1) debug smtp: found extension "enhancedstatuscodes", arg "" 16:29:24,875 info [stdout] (http-localhost-127.0.0.1-8080-1) debug smtp: found extension "8bitmime", arg "" 16:29:24,875 info [stdout] (http-localhost-127.0.0.1-8080-1) debug smtp: found extension "dsn", arg "" 16:29:24,895 info [stdout] (http-localhost-127.0.0.1-8080-1) debug smtp: use8bit false 16:29:24,895 info [stdout] (http-localhost-127.0.0.1-8080-1) mail from:<temp@edfx-desktop-28> 16:29:25,135 info [stdout] (http-localhost-127.0.0.1-8080-1) 250 2.1.0 ok 16:29:25,135 info [stdout] (http-localhost-127.0.0.1-8080-1) rcpt to:<diganta.xxx@gmail.com> 16:29:25,365 info [stdout] (http-localhost-127.0.0.1-8080-1) 250 2.1.5 ok 16:29:25,365 info [stdout] (http-localhost-127.0.0.1-8080-1) debug smtp: verified addresses 16:29:25,365 info [stdout] (http-localhost-127.0.0.1-8080-1) debug smtp: diganta.xxxx@gmail.com 16:29:25,365 info [stdout] (http-localhost-127.0.0.1-8080-1) data 16:29:25,615 info [stdout] (http-localhost-127.0.0.1-8080-1) 354 end data <cr><lf>.<cr><lf> 16:29:25,615 info [stdout] (http-localhost-127.0.0.1-8080-1) date: fri, 3 may 2013 16:29:24 +0530 (ist) 16:29:25,615 info [stdout] (http-localhost-127.0.0.1-8080-1) to: diganta.xxxx@gmail.com 16:29:25,615 info [stdout] (http-localhost-127.0.0.1-8080-1) message-id: <628313650.2.1367578764895.javamail.temp@edfx-desktop-28> 16:29:25,615 info [stdout] (http-localhost-127.0.0.1-8080-1) subject: request remove rounak dey's activity's manager privilege 16:29:25,625 info [stdout] (http-localhost-127.0.0.1-8080-1) activity efxl13001 16:29:25,625 info [stdout] (http-localhost-127.0.0.1-8080-1) mime-version: 1.0 16:29:25,625 info [stdout] (http-localhost-127.0.0.1-8080-1) content-type: multipart/mixed; 16:29:25,625 info [stdout] (http-localhost-127.0.0.1-8080-1) boundary="----=_part_0_263230409.1367578763564" 16:29:25,625 info [stdout] (http-localhost-127.0.0.1-8080-1) 16:29:25,625 info [stdout] (http-localhost-127.0.0.1-8080-1) ------=_part_0_263230409.1367578763564 16:29:25,625 info [stdout] (http-localhost-127.0.0.1-8080-1) content-type: multipart/related; 16:29:25,625 info [stdout] (http-localhost-127.0.0.1-8080-1) boundary="----=_part_1_1514490209.1367578763584" 16:29:25,625 info [stdout] (http-localhost-127.0.0.1-8080-1) 16:29:25,625 info [stdout] (http-localhost-127.0.0.1-8080-1) ------=_part_1_1514490209.1367578763584 16:29:25,625 info [stdout] (http-localhost-127.0.0.1-8080-1) content-type: text/html; charset=us-ascii 16:29:25,625 info [stdout] (http-localhost-127.0.0.1-8080-1) content-transfer-encoding: 7bit 16:29:25,625 info [stdout] (http-localhost-127.0.0.1-8080-1) 16:29:25,625 info [stdout] (http-localhost-127.0.0.1-8080-1) <html><body><a href=http://localhost:8080/activitydatabase/req/acceptordenypermision.xhtml?activityid=efxl13001&uniqueid=7fe18301-0bde-48da-a7d1-2bbe43b95e98&emailid=diganta.xxxx@gmail.com>accept or deny request..</a></body></html> 16:29:25,625 info [stdout] (http-localhost-127.0.0.1-8080-1) ------=_part_1_1514490209.1367578763584-- 16:29:25,625 info [stdout] (http-localhost-127.0.0.1-8080-1) 16:29:25,625 info [stdout] (http-localhost-127.0.0.1-8080-1) ------=_part_0_263230409.1367578763564-- 16:29:25,625 info [stdout] (http-localhost-127.0.0.1-8080-1) . 16:29:25,855 info [stdout] (http-localhost-127.0.0.1-8080-1) 250 2.0.0 ok: queued 164b322ab7 16:29:25,855 info [stdout] (http-localhost-127.0.0.1-8080-1) quit 16:29:26,046 info [stdout] (http-localhost-127.0.0.1-8080-1) 221 2.0.0 bye
your server doesn't support starttls , won't let authenticate unless connect on ssl begin with. without authenticating, won't deliver mail outside of domain. assuming you're using new version of javamail, set property "mail.smtp.ssl" "true".
Comments
Post a Comment