🦲
mind
  • cleber's mind
  • plans
    • fact checking
    • personal assistant
  • self-management
    • agenda and tasks
    • mails and emails
  • knowledge
    • career
    • programming
      • Big O Notation
      • browsing data
      • C/C++
      • databases
      • eclipse
      • gradle
      • java
        • apache camel
      • javascript
      • naming convention
      • mysql
      • prolog
      • regex
      • REST
      • ssl/tls
      • version control
        • git commands
      • web-semantics
      • wot
    • research
      • mas
      • planning
      • math
        • probability
      • machine learning
      • nlp
      • speech recognition
      • data sources
      • data visualisation
    • it
      • asterisk
      • containers
        • installing docker
        • deploying busybox
        • deploying a sample
        • deploying node-red
        • deploying from the hub
      • clusters
        • installing kubernetes
        • deploying bootcamp
        • deploying nginx
        • deploying jacamo-rest
        • grafana
      • deploy
        • heroku
      • linux
        • tmux
        • vim
        • startup
      • networks
      • pdf
        • ssh
    • productivity
    • language
      • expressions
        • nice signposts
        • linking expressions
      • latex
      • scientific
      • writing
    • sailing
    • financial
      • assets
    • emergency
    • out of boxes
  • teaching
    • eletrônica digital
      • Conversão decimal para binário
      • Conversão binário para decimal
      • Sinais analógicos vs digitais
    • programação I
    • cabeamento estruturado
  • moments
    • insightful ai facts
    • ai4industry-hackathon
    • previous activities
  • brasil
  • external links
    • personal webpage
    • my github
Powered by GitBook
On this page
  • Creating a component from archetype
  • Sending email (gmail) by camel routes

Was this helpful?

  1. knowledge
  2. programming
  3. java

apache camel

PreviousjavaNextjavascript

Last updated 5 years ago

Was this helpful?

Creating a component from archetype

Sending email (gmail) by camel routes

  1. Enable .

    1. Enable (following verification through SMS).

    2. Generate a password for the camel app (selecting app "Mail" and a device type or custom). It will venerate a 16 characters password for the camel app.

  2. Make sure the app is set up for component.

  3. Set up a camel route

    1. Set the consumer side ('from' of camel route).

    2. Set a message subject, recipient and body.

    3. Set the producer side (mail following ).

      1. Use secure smtp on port 465 (smtps://smtp.gmail.com:465).

      2. Set the username as a valid gmail address (ex: username=myuser@gmail.com).

      3. Set the 16 characters generated app password (ex: password=abcd1234abcd5678).

      4. Set smtp authentication (mail.smtp.auth=true).

      5. Set STARTTLS as enabled (mail.smtp.starttls.enable=true).

Example:

<routes xmlns="http://camel.apache.org/schema/spring" >
        <route id="sendMail">
                <from uri="jason:toEmail" />
                <setBody>
                        <!-- remove quotes -->
                        <simple>${body.replaceAll("\u0022","")}</simple>
                </setBody>
                <setHeader headerName="Subject">
                        <simple>${in.body}</simple>
                </setHeader>
                <setHeader headerName="To">
                        <constant>recipient@gmail.com</constant>
                </setHeader>
                <setBody>
                        <simple>${in.body}\nHi, Some message.\n</simple> 
                </setBody> 
                
                <!-- gmail configuration -->
                <to uri="smtps://smtp.gmail.com:465?username=myuser@gmail.com&password=abcd1234abcd5678&debugMode=true&mail.smtp.auth=true&mail.smtp.starttls.enable=true"/> 
        </route>  
</routes>
How to create a camel component from archetype
gmail app passwords
2-step-verification
camel-mail
gmail smtp configuration