Home | Forums | Contact | Search | Syndication  
 
 [login] [create account]   Wednesday, June 18, 2025 
 
slxdeveloper.com Community Forums  
   
The Forums on slxdeveloper.com are now retired. The forum archive will remain available for the time being. Thank you for your participation on slxdeveloper.com!
 Architect Forums - SalesLogix Scripting & Customization
Forum to discuss writing script in Architect plugins for SalesLogix & general SalesLogix customization topics (for Windows client only). View the code of conduct for posting guidelines.
Forums RSS Feed


 Back to Forum List | Back to SalesLogix Scripting & Customization | New ThreadView:  Search:  
 Author  Thread: Autosending Email from Server
John Gundrum
Posts: 632
Top 10 forum poster: 632 posts
 
Autosending Email from ServerYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 26 Mar 07 2:54 PM
fiogf49gjkf0d
We have a requirement to send an email to a history contact after the history is completed. Looking to do this on the server to avoid all the issues of having to configure clients to send email in the background (setting up SMTP, relays, etc.)

Looking for sample code on how this would be done using .NET where an EXE would be created that is run every so often to check the table for new history and send the email.

Thanks much in advanced!
John G.
[Reply][Quote]
Ryan Farley
Posts: 2265
slxdeveloper.com Site Administrator
Top 10 forum poster: 2265 posts
 
Re: Autosending Email from ServerYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 26 Mar 07 4:19 PM
fiogf49gjkf0d
A simple route would be to have a .NET exe that you could just kick off from the windos scheduler, scan the history table for all new items *since the last time it ran*, logs the new execution time, and sends the emails.

It would probably work to not have to keep track of all the specific historyid values you have sent to, but instead just log the current time and then each time you just check for all new items since the last time it ran.

As far as sending the e-mails:

System.Net.Mail.MailMessage message = new System.Net.Mail.MailMessage();

message.To.Add("sendtome@email.com");
message.Subject = "This is my e-mail...";
message.From = new System.Net.Mail.MailAddress("fromme@email.com");
message.IsBodyHtml = false;
message.Body = "This is my e-mail message!";
System.Net.Mail.SmtpClient smtp = new System.Net.Mail.SmtpClient("mySMTPserver");

//this line can be omitted if the SMTP server accepts relaying from the current machine
smtp.Credentials = new NetworkCredential("username", "mypassword");
smtp.Send(message);


Keep in mind, if you're using .NET 2.0, you'll want to use the newer System.Net.Mail namespace, not the older System.Web.Mail.

You can see a whole lot of good stuff on System.Net.Mail here: http://www.systemnetmail.com/

-Ryan
[Reply][Quote]
John Gundrum
Posts: 632
Top 10 forum poster: 632 posts
 
Re: Autosending Email from ServerYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 29 Mar 07 6:41 AM
fiogf49gjkf0d
Thanks Ryan!
[Reply][Quote]
John Gundrum
Posts: 632
Top 10 forum poster: 632 posts
 
Re: Autosending Email from ServerYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 23 Apr 07 10:50 AM
fiogf49gjkf0d
You can see a whole lot of good stuff on System.Net.Mail here: http://www.systemnetmail.com/


Very cool site. Definitely going to make use of it!
[Reply][Quote]
Ryan Farley
Posts: 2265
slxdeveloper.com Site Administrator
Top 10 forum poster: 2265 posts
 
Re: Autosending Email from ServerYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 23 Apr 07 10:54 AM
fiogf49gjkf0d
Yes, that is a great site. If you're using .NET 1.1 you can see the System.Web.Mail for .NET 1.1 equivalent here: http://www.systemwebmail.com/ (for .NET 2.0, you'd want to use the System.Net.Mail namespace)
[Reply][Quote]
 Page 1 of 1 
  You can subscribe to receive a daily forum digest in your user profile. View the site code of conduct for posting guidelines.

   Forum RSS Feed - Subscribe to the forum RSS feed to keep on top of the latest forum activity!
 

 
 slxdeveloper.com is brought to you courtesy of Ryan Farley & Customer FX Corporation.
 This site, and all contents herein, are Copyright © 2025 Customer FX Corporation. The information and opinions expressed here are not endorsed by Sage Software.

code of conduct | Subscribe to the slxdeveloper.com Latest Article RSS feed
   
 
page cache (param): 6/18/2025 2:22:55 AM