spring - Setup mailx as Java SMTP Configuration -
spring - Setup mailx as Java SMTP Configuration -
i trying send email java/spring software. i'm using javamailsender of spring framework. how can configure local machine javamailsender's smtp host? can send email via next command:
echo “test123” | mailx -s “test mail” emailaddress@email.com however, how can write mail.properties back upwards command above?
this javamailsender bean:
<bean id="javamailsender" class="org.springframework.mail.javamail.javamailsenderimpl"> <property name="host" value="${mail.smtp.host}" /> <property name="port" value="${mail.smtp.port}" /> <property name="defaultencoding" value="${mail.defaultencoding}" /> <property name="username" value="${mail.username}" /> <property name="password" value="${mail.password}" /> <property name="javamailproperties"> <props> <prop key="mail.debug">${mail.debug}</prop> <prop key="mail.smtp.auth">${mail.smtp.auth}</prop> <prop key="mail.smtp.starttls.enable" >${mail.smtp.starttls.enable}</prop> </props> </property> </bean> this mail.properties file:
mail.debug = true mail.defaultencoding = utf-8 mail.smtp.host = localhost mail.smtp.port = 25 mail.username = mail.password = mail.smtp.starttls.enable = false mail.smtp.auth = false
my understanding mailx mail service client need mail service server looking for.
if desktop development environment issue have @ smtp4dev
otherwise on unix scheme install smtpd or hook exchange widows environment.
java spring email smtp
Comments
Post a Comment