India

ZestyBeanz Technologies Pvt Ltd 4th Floor, Nila, Technopark Thiruvananthapuram,
India – 695581
Phone: +91 471 4063254
Fax : +91 471 2700171

   .

ZestyBeanz Technologies Pvt Ltd
61/3236, Manikkath Cross Road
Ravipuram, Kochi, India - 682016
Phone: +91 484 4063254

  UAE

Zesty Labs
Office # 2003, Millennium Plaza Building
Sheikh Zayed Rd, Dubai, UAE
Phone: +971 4333 2222​
Mobile: +971-52-7553466

  Germany​

ZestyBeanz Technologies GmbH
Reuterstraße 1
90408 Nürnberg
Fon: +49 911 4801 444
Fax: +49 911 4801 445

Contact Form


Vishnu Devaraj's picture

Sending Emails from OpenERP Using the Module 'smtpclient'

    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, [email protected] . 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.

Reply

The content of this field is kept private and will not be shown publicly.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.
  • You can enable syntax highlighting of source code with the following tags: <code>, <blockcode>, <c>, <cpp>, <drupal5>, <drupal6>, <java>, <javascript>, <php>, <python>, <ruby>. The supported tag styles are: <foo>, [foo], [[foo]]. PHP source code can also be enclosed in <?php ... ?> or <% ... %>.

More information about formatting options

CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.
Image CAPTCHA
Enter the characters shown in the image. Ignore spaces and be careful about upper and lower case.