Red Lion Email

The Wiz

Member
Join Date
Feb 2011
Location
West TN
Posts
5
Trying to send an email of one var. got the email part working but cant seem to get the var embeded in the email. below is my code. can anyone help?

cstring Subject, body;
Subject= "Day Report";
body+= DecToText(DayStrokes, 1, 5, 0, 0, 0);
SendMail(0,Subject,body);



would like to get the subject to say "Day Report" and the body of email to display Daystrokes var
 
The "+=" operator is like writing body=body+ ...
I am not sure if that is legit with a string tag

Instead try:
body:= DecToText(DayStrokes, 1, 5, 0, 0, 0);

Also, is DayStrokes a Numeric tag? Is it identified it correctly? I chased my tail for an hour once because I left out the folder designator for a tag in a script. Now I realize that I can double click the text I have typed in a funtion and it will be highlighted. next I simply drag a tag from the resources pane onto that selected text and it gets replaced with exactly the right information.

I often have issues getting my operators correct in Crimson, so I frequently use the Watch window to see the results of the operations...this might help you.

EDIT: One more thing...since body is a local variable in your script, its contents might go away by the time the email gets sent. You might try again using an internal string tag for the body instead of a local variable.
 
Last edited:
Thanks OkiePC,,,that was the ticket. Now if I can figure out how to get the word "Cans" behind my var....LOL

Thanks again
 
The Wiz said:
Thanks OkiePC,,,that was the ticket.
Which was it, the assignment operator or the local variable?

The Wiz said:
Now if I can figure out how to get the word "Cans" behind my var....LOL

Thanks again
Try this:
body:=AsText(DayStrokes)+" Cans";

or

body:=DayStrokes.AsText+" Cans";

:)

It works on the emulator, and is simpler than the DecToText function.
The DecToText would be more useful with formatting a floating point value but if your tag is an integer, the astext property or function might be more efficient.
 
Last edited:
It was the assignment operator. My var was an int. Funny thing is I called tech support three times. They were very nice but didnt get any where. I will try the other next week. Might need to get your input on the emulator.
Thanks again......
 
Top of the day OkiePC....Messing around with the Emulator...Any thing special I need to do to send an email through it? Emulator is pointed at my enet card in my laptop but I read something about mapping?
 
Last edited:
I have not tried that. I thought about setting up some email messgaes but knew that I would need IT help to identify the mail server correctly, and give my G3 an email address, but my IT guys are buried neck deep in other projects right now.

Perhaps one of the Red Lion guys will see this and let us know if that feature is possible through the emulator.
 
LOL I can help with that. If you know who supplies your company with internet say like "Charter" open a CMD line and ping mail.yourcarrier.com or mail.yourcarrier.net If you get a an ip address back your all set. I move around alot and need my email so thats what I do to get it working.
 

Similar Topics

Hi everyone, I have a Red Lion CR3000 HMI that I am trying to set up to send a email when there are certain alarms. So far I have had no luck...
Replies
8
Views
4,455
Hi Everyone, I'm using a small program to generate emails when certain conditions are met like when a counter exceeds a value. I was hoping that...
Replies
1
Views
2,005
Hi all, I have a customer that wants me to send a email based on a specific event. I have created a trigger that creates a Data File based on...
Replies
12
Views
3,291
Greetings All Need pointing in the right direction. Been a few days, configured G3 email feature with no success. Checked IP addresses or all...
Replies
3
Views
2,580
Anybody using the G3 email feature? I have tried a few things but haven't been able to get it to send me an email. I'm sure (well pretty sure) it...
Replies
12
Views
8,381
Back
Top Bottom