Official ScriptUO EasyUO Scripts > Script Snippets

TrailMyx's Emailing routines

(1/1)

TrailMyx:
Sometimes it's really nice to email yourself status from a script that's busy doing something nefarious.  For that I use the following tool:

http://www.daveswebsite.com/software/sendmail/

You have to set up an XML file that contains the necessary information to send mail through your particular email server.  Typically, if you use your ISP email address, this seems to work well.  You're on your own if you want to use anything else.  So create an XML file:

Edit: Annoying thing about having XML embedded into the code container below; doesn't work!  So, change the "{" to "<"


--- Code: ---{Sendmail>
    {Server host="smtp.XXXX.YYYY.net" port="25" username="" password=""/>   
    {Message>
        {Sender email="myemail@server.net" name="EasyUO Daemon"/>
        {Recipient email="mycellphone@att.com" name="YurName"/>
      {Subject>Death Alert{/Subject>
        {Body filename="z:\scripts\message.txt"/>
    {/Message>
{/Sendmail>
--- End code ---

The things you need to edit are:
Server host="smtp.XXXX.YYYY.net"
Sender email="myemail@server.net"
Recipient email="mycellphone@att.com"
Body filename="z:\scripts\message.txt"

Make sure you edit this above information in the XML file to be compatible with your email/recipient/body.

This routine creates a message called "message.txt" that contains whatever mesage you want to send.  Be sure that the filename matches the one that your above XML code is expecting.


--- Code: easyuo ---sub SendDeathMail  set %messagefile z:\scripts\message.txt  execute cmd.exe /c echo > %messagefile  execute cmd.exe /c echo >> %messagefile %1  execute z:\scripts\sendmail.exe z:\scripts\deathmail.xmlreturn
Finally, you can call this to issue the email from your code:


--- Code: easyuo ---set %text_string #CHARNAME, #spc , diedgosub SendDeathMail NULL %text_string

Hope that's helpful!

TM

JlM:
This still work? Couldn't get it. I might not be understanding the complexity of setting it up.

TrailMyx:

--- Quote from: JlM on October 23, 2018, 06:14:30 AM ---This still work? Couldn't get it. I might not be understanding the complexity of setting it up.

--- End quote ---

It should still work.  Sadly the link that was setup to download the email server no longer exists.

Navigation

[0] Message Index

Go to full version