AI Zone Admin Forum Add your forum

NEWS: Chatbots.org survey on 3000 US and UK consumers shows it is time for chatbot integration in customer service!read more..

How to send email to any account by having a body text and subject using AIML tag?
 
 

I have been trying to find the solution but not getting any simple code snippet
for it. Can anyone please help me out? I did research here https://github.com/pandorabots/aiml-en-us-pandorabots-callmom/blob/master/callmom_email.aiml but not understanding what to do exactly.

 

 
  [ # 1 ]

I am trying something below

<category>
    <
pattern>TEST EMAIL</pattern>
    <
that>WHAT IS YOUR EMAIL ADDRESS</that>
    <
template>
        <
think><set name="emailaddress"><star/></set></think>
          <
url>mailto:abc@gmail.com?Subject=New Email Address&amp;Body=new email address: <get name="emailaddress"/></url>
    </
template>
</
category
 

 
  [ # 2 ]

You are referencing a wildcard in your template but there is no wildcard in your pattern. The rest is correct though. However, it’s up to your interpreter to say what the url tag does. Are you using Pandorabots.com to make your bot? If so, this will work by using a button:

<category>
        <
pattern>TEST EMAIL</pattern>
        <
template>Shall I send a test email?
            <
button>
                <
text>That sounds good</text>
                <
url>mailto:abc@gmail.com?Subject=New Email Address&amp;
                
Body=new email address
                </
url>
            </
button>
        </
template>
    </
category

More details here: https://www.chatbots.org/ai_zone/viewthread/3454/
You can also try this much older method which may still work:

<category>
<
pattern>SEND *</pattern>
<
template>Try sending mail to DrWallace (<a target="_new" href="mailto:[email protected]">drwallace@alicebot.org</a>)
<
think><set name="he">DrWallace</set></think>
</
template></category
 

 
  [ # 3 ]

Thanks for your reply, actually I am working on a project taken from here https://github.com/nihal111/J.A.R.V.I.S/blob/master/basic_chat.aiml, not understanding which bot is this? but using in the top of AIML file <?xml version=“1.0” encoding=“UTF-8”?><aiml version=“2.0”>
I have tried your both codes but neither error nor email. Sorry for asking again.

Another issue is I am trying to use voice command and recognition so the button tag?

 

 
  [ # 4 ]

Now I am trying something like below :

<category>
<
pattern>EMAIL RICHARD ABOUT *</pattern>
<
template>Sending "<star index="1"/>" to Richard with subject "<star/>".
<
oob><email><to>zesanriky@gmail.com</to><subject><star/></subject><body><star index="2"/></body></email></oob>
</
template>
</
category

It is saying: sending email to Richard with subject but still, my inbox is empty.

 

 
  [ # 5 ]

Have you created two threads about this for a reason? My answer is on your other thread but to summarise, you have to say in your interpreter how to send an email. oob simply means, “do something outside of AIML”.

What interpreter are you using?

 

 
  [ # 6 ]

Hi Worswick, I am so sorry that I thought my another post might be more clear to understand what I am trying to achieve. But anyway coming to your questions. I am using Python as an interpreter. In Python, I know how to send an email but don’t know how to make a connection with AIML email tag.

 

 
  [ # 7 ]

I would do this by checking the bot’s response. If it contains your email tag, then get your Python script to send the email.

 

 
  login or register to react