OpenERP has many methods and modules to handle the emailing functionality flexibly. One among them is the module named ‘smtpclient’. Once the module is installed the following menus are created .
Menus
Administration/Configuration/Sendmail Services
Administration/Configuration/Sendmail Services/SMTP Servers
Administration/Configuration/Sendmail Services/SMTP Servers/Message Queue
Administration/Configuration/Sendmail Services/SMTP Servers/Sent Email History
We start the configuration steps from the menu “Administration/Configuration/Sendmail Services/SMTP Servers”. An SMTP server allows a user to send emails from OpenERP using his email id and password. We can create as many servers as we like. But two different servers with same email id is not allowable.
The picture below shows a list of SMTP Sever instances. Each server is used for different purposes. For example, one is used for sending emails related to marketing and that may be configured using the email id of the marketing section and one for sending task related emails and that one uses the email id of the project management section.
Now we create a new entry from the menu where we are now (“Administration/Configuration/Sendmail Services/SMTP Servers” )
Configuration Tab
Here i am mentioning the necessary fields only, leaving some fields that are not much important
Server Name : You Can Use any name. This filed is just for the purpose of identifying your server
Server Type : The selection field allows you to choose the server related to the email id you are going to provide . It automatically fills some basic details of the server if you are selecting yahoo or google. Other wise you have to provide them manually
Email Address : Specify the email address
SMTP Server : If the server type you selected is “Other Mail Servers”, provide the corresponding value(may be something like ‘smtp.yourdomain.com’)
Email From : The Name to be displayed in the “From” field
SMTP Port : port number of your smtp server(25 is the default value)
Use Auth : Check the field
Use SSL : You have to check or un-check the field based on your SMTP Server. If Google is the server it must be checked.
User Name and Password : provide the complete user name including the domain like, contact@zbeanztech.com . Provide the password
Permission Tab
Select and include all the users who are indented to use this particular server. Save the form
Server Verification
After Saving all the details, use the wizard, ‘Send Verification Code’. It prompts for an email id. Provide any email id. The verification code will be sent to that email address. Now use the wizard “Verify Server”. Provide the verification code you received in email. Once you provide the correct code the “Server Status” changes to “Verified”. After verification “Start” the server, using the button . Now your server is ready to send emails. You can test it by using the wizard “Send Test Email”
Message Queue
Every mail triggered from the server is first passed into the Message Queue and there after processed with the help of a scheduler. The message queue helps the user to identify whether the email was sent or not. The field “Message Status” indicates the status of the message in the queue
“Send Email” Scheduler
Scheduler is another use full feature of OpenERP, which i have mentioned in another blog named Schedulers in OpenERP . You can see the particular scheduler here “Administration/Configuration/Scheduler/Scheduled Actions”.
As per default configuration, the “Send Email” Scheduler, checks and processes the message queue every one minute. Ultimately this scheduler is the one that is responsible for sending emails. So make sure that it is active and configured properly.
Developers can evoke the “send_email” funcion of the object ’email.smtpclient’, in situations where an email is to be send. The function takes smtp server id, list of recepient email ids , subject , body etc.. as its arguments. Even reports and attchments also can be passed as arguments so that the email will carry them.
Juliann: Thanks for ones marvelous posting! I certainly enjoyed reading it, you will be a great author.I will make sure to bookmark your blog and will come back later on. I want to encourage you to ultimately continue your great writing, have a nice weekend!".
Leave a Reply