|
charneus Wizard
Joined: 19 Jun 2005 Posts: 1876 Location: California
|
Posted: Sun Jul 12, 2009 11:00 pm
Adding colors question... |
I use a script that emails notes to me posted on any board in Aardwolf. Script works wonderfully (except for the occasional 'Transport send' (or whatever) failure), but I'm wondering if there is a way I can add color to the emails based on what's posted.
For instance, if someone posts:
This is a post with color.
all I get is:
This is a post with color.
The way the script works is for the lines it receives in the note, it stores it into a variable, then uses COM object to send whatever is in the variable to me. It seems like it'd be something simple, though it's probably a lot harder than I think. However, any help would be greatly appreciated!
Charneus |
|
|
|
Rahab Wizard
Joined: 22 Mar 2007 Posts: 2320
|
Posted: Mon Jul 13, 2009 1:55 pm |
Well, first of all, in order for it to send you email in color, it will have to be more than plain text email. I don't know offhand what changes you'd have to make to the email header; it's been almost twenty years since I played with the mail protocol. But it would require some extra header fields specifying a MIME type, and formatting your message into that MIME type.
|
|
|
|
charneus Wizard
Joined: 19 Jun 2005 Posts: 1876 Location: California
|
Posted: Mon Jul 13, 2009 2:17 pm |
Lovely. Given my limited knowledge about COM objects in the first place, I wouldn't even know where to begin, and that really sucks. The reason for this is because sometimes the notes just don't make sense without color in it.
If there is an easier way to do it, that'd be great. If not, well, I'll have to deal with it, I guess. If someone knows exactly how to do it but needs the script, send me a PM and I'll let you look over it.
Greatly appreciated!
Charneus |
|
|
|
Taz GURU
Joined: 28 Sep 2000 Posts: 1395 Location: United Kingdom
|
Posted: Thu Jul 16, 2009 7:37 pm |
You need to convert the text into html, in my opinion the hardest part of your problem and then as part of your com mail object more than likely called msg you just need to do msg.HTMLBody = strHTML as opposed to msg.Body = strBody
|
|
_________________ Taz :) |
|
|
|
charneus Wizard
Joined: 19 Jun 2005 Posts: 1876 Location: California
|
Posted: Thu Jul 16, 2009 11:50 pm |
Ah. Definitely can change the msg.Body part.
I think you're right about the conversion to html being the hardest part. There isn't a simple way to store the ansi colors in with the variable? I only have 16 colors to deal with, but really I don't want to write a number of triggers to convert the string to html. It'd be nice if at least #WRITE allowed an option to write a trigger with html colors. I guess I'll dig around to see what I can find, though. Thanks!
Charneus |
|
|
|
Tech GURU
Joined: 18 Oct 2000 Posts: 2733 Location: Atlanta, USA
|
Posted: Fri Jul 17, 2009 2:35 pm |
I think buried in one of my scripts I wrote code that converted ansi colors into HTML or what I considered the equivalent. I'll try and dig it up this weekend. Ping me on Monday if I don't post it by then.
|
|
_________________ Asati di tempari! |
|
|
|
|
|