As we transition to the new Hyland Community, some post links may be temporarily disrupted as we finalize redirects. We apologize for the inconvenience and are working to resolve this as quickly as possible. Details.
<property name="host"> <value>smtp.gmail.com</value> </property> <property name="port"> <value>465</value> </property> <property name="protocol"> <value>smtps</value> </property> <property name="username"> <value>userName@gmail.com</value> </property> <property name="password"> <value>UserPassword</value> </property> <property name="defaultEncoding"> <value>UTF-8</value> </property> <property name="javaMailProperties"> <props> <prop key="mail.smtps.auth">true</prop> <prop key="mail.smtp.socketFactory.port">465</prop> <prop key="mail.smtp.socketFactory.class">javax.net.ssl.SSLSocketFactory</prop> <prop key="mail.smtp.socketFactory.fallback">false</prop> <prop key="mail.smtp.timeout">25000</prop> <prop key="mail.smtps.starttls.enable">true</prop> </props> </property>
<bean id="mailService" class="org.springframework.mail.javamail.JavaMailSenderImpl"> <property name="host"> <value>${mail.host}</value> </property> <property name="port"> <value>${mail.port}</value> </property> <property name="protocol"> <value>${mail.protocol}</value> </property> <property name="username"> <value>${mail.username}</value> </property> <property name="password"> <value>${mail.password}</value> </property> <property name="defaultEncoding"> <value>${mail.encoding}</value> </property> <property name="javaMailProperties"> <props> <prop key="mail.smtps.auth">${mail.smtps.auth}</prop> <prop key="mail.smtps.starttls.enable">${mail.smtps.starttls.enable}</prop> </props> </property> </bean>
# Email configuration mail.host=smtp.gmail.com mail.port=465 mail.protocol=smtps mail.username=user@gmail.com mail.password=password mail.smtps.starttls.enable=true mail.smtps.auth=true
####################################### ####### Sample Gmail settings ######## ####################################### ### E-mail site invitation setting ### #notification.email.siteinvite=false ### Original notification.email.siteinvite=true #Mail Setup mail.host=smtp.gmail.com mail.port=465 mail.protocol=smtps mail.username=xxxxxx@gmail.com mail.password=xxxxxxxxxx #please note that you need to get site specific password from your gmail account mail.encoding=UTF-8 #### New Properties #### mail.smtps.starttls.enable=true mail.smtps.auth=true ##### Test SMTP setup mail.testmessage.send=true mail.testmessage.to=xxxxxx@live.com mail.testmessage.subject=Outbound SMTP mail.testmessage.text=The Outbound SMTP email subsystem is working.
<bean id="mailService" class="org.springframework.mail.javamail.JavaMailSenderImpl"> <property name="host"> <value>${mail.host}</value> </property> <property name="port"> <value>${mail.port}</value> </property> <property name="protocol"> <value>${mail.protocol}</value> </property> <property name="username"> <value>${mail.username}</value> </property> <property name="password"> <value>${mail.password}</value> </property> <property name="defaultEncoding"> <value>${mail.encoding}</value> </property> <property name="javaMailProperties"> <props> <prop key="mail.smtp.auth">${mail.smtp.auth}</prop> <prop key="mail.smtp.debug">${mail.smtp.debug}</prop> <prop key="mail.smtp.timeout">${mail.smtp.timeout}</prop> <prop key="mail.smtp.starttls.enable">${mail.smtp.starttls.enable}</prop> <prop key="mail.smtps.auth">${mail.smtps.auth}</prop> <prop key="mail.smtps.starttls.enable">${mail.smtps.starttls.enable}</prop> </props> </property> </bean>
<?xml version='1.0' encoding='UTF-8'?> <!DOCTYPE beans PUBLIC '-//SPRING//DTD BEAN//EN' 'http://www.springframework.org/dtd/spring-beans.dtd'> <beans> <!– –> <!– MAIL SERVICE –> <!– –> <bean id="mailService" class="org.springframework.mail.javamail.JavaMailSenderImpl"> <property name="host"> <value>${mail.host}</value> </property> <property name="port"> <value>${mail.port}</value> </property> <property name="protocol"> <value>${mail.protocol}</value> </property> <property name="username"> <value>${mail.username}</value> </property> <property name="password"> <value>${mail.password}</value> </property> <property name="defaultEncoding"> <value>${mail.encoding}</value> </property> <property name="javaMailProperties"> <props> <prop key="mail.smtps.auth">${mail.smtps.auth}</prop> <prop key="mail.smtps.starttls.enable">${mail.smtps.starttls.enable}</prop> </props> </property> </bean> </beans>
Your first error seems to be Unknown host exception for "smtp.gmail.com".So can you ping smtp.gmail.com? What's wrong with your infrastructure, have you got a firewall in the way?
Yes that is a concern. However from memory the subsystem framework was new in 3.2 and I can't remember in which release SMTP was refactored to use subsystems. Its possible your version has "old style" configuration which would be custom-email-server.properties.You should never touch anything below WEB-INF (since its Alfresco's private implementation detail,) you can look but you shouln't change stuff because it will get lost on upgrade..The first thing to check is that you can connect to your email server (gmail?) from the box that you want to send email from. Use whatever email client you have available. That will validate all the paths and settings needed. Then you can worry about alfresco's configuration.
### E-mail site invitation setting ### notification.email.siteinvite=false
### E-mail site invitation setting ### notification.email.siteinvite=true
I've solved the problem. It was actually very simple but I haven't seen this documented anywhere..In the default installation version of alfresco-global.properties there is a line that reads:-### E-mail site invitation setting ### notification.email.siteinvite=falseJust change it to read:-### E-mail site invitation setting ### notification.email.siteinvite=true
Now, we need to enable SMTPS by overriding the mailService bean. Create and edit <TOMCAT_HOME>/classes/alfresco/extension/custom-email-context.xml and paste in the following:
<?xml version='1.0' encoding='UTF-8'?> <!DOCTYPE beans PUBLIC '-//SPRING//DTD BEAN//EN' 'http://www.springframework.org/dtd/spring-beans.dtd'> <beans> <!– –> <!– MAIL SERVICE –> <!– –> <bean id="mailService" class="org.springframework.mail.javamail.JavaMailSenderImpl"> <property name="host"> <value>${mail.host}</value> </property> <property name="port"> <value>${mail.port}</value> </property> <property name="protocol"> <value>${mail.protocol}</value> </property> <property name="username"> <value>${mail.username}</value> </property> <property name="password"> <value>${mail.password}</value> </property> <property name="defaultEncoding"> <value>${mail.encoding}</value> </property> <property name="javaMailProperties"> <props> <prop key="mail.smtps.auth">${mail.smtps.auth}</prop> <prop key="mail.smtps.starttls.enable">${mail.smtps.starttls.enable}</prop> </props> </property> </bean> </beans>
Have you followed all of the steps on the link I posted above?Now, we need to enable SMTPS by overriding the mailService bean. Create and edit <TOMCAT_HOME>/classes/alfresco/extension/custom-email-context.xml and paste in the following: <?xml version='1.0' encoding='UTF-8'?> <!DOCTYPE beans PUBLIC '-//SPRING//DTD BEAN//EN' 'http://www.springframework.org/dtd/spring-beans.dtd'> <beans> <!– –> <!– MAIL SERVICE –> <!– –> <bean id="mailService" class="org.springframework.mail.javamail.JavaMailSenderImpl"> <property name="host"> <value>${mail.host}</value> </property> <property name="port"> <value>${mail.port}</value> </property> <property name="protocol"> <value>${mail.protocol}</value> </property> <property name="username"> <value>${mail.username}</value> </property> <property name="password"> <value>${mail.password}</value> </property> <property name="defaultEncoding"> <value>${mail.encoding}</value> </property> <property name="javaMailProperties"> <props> <prop key="mail.smtps.auth">${mail.smtps.auth}</prop> <prop key="mail.smtps.starttls.enable">${mail.smtps.starttls.enable}</prop> </props> </property> </bean> </beans>
I did except for the "Email Action Executor"Alfresco uses the action service to send email.MailActionExecuter The following properties can be set.PARAM_NAME = "mail"PARAM_TO = "to"PARAM_TO_MANY = "to_many"PARAM_SUBJECT = "subject"PARAM_TEXT = "text"PARAM_FROM = "from"PARAM_TEMPLATE = "template";FROM_ADDRESS = "alfresco@alfresco.org";I am not sure of how to do this one. If we have to set this manually, can you let me know on how to do this? This is the only step i missed.