Home | Forums | Contact | Search | Syndication  
 
 [login] [create account]   Sunday, July 6, 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: How to code for sending Email ???
Suwisa
Posts: 5
 
How to code for sending Email ???Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 06 Sep 10 10:36 PM
I would like to code for sending email by myself. Does anybody know how to code? Please give me for example.
[Reply][Quote]
Thomas Aussem
Posts: 57
 
Re: How to code for sending Email ???Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 07 Sep 10 4:20 AM
Hi Suwisa,

here is a short example of using Application.BasicFunctions.QueMessage, which will open the email client with passed parameters:

Dim strTo, strCC, strBCC, strSubject, strBody, strAttachment

strTo = "me@myaccount.com"
strCC = ""
strBCC = ""
strSubject = "test email"
strBody = "Hello World"
strAttachment = ""

Application.BasicFunctions.QueMessage strTo, strCC, strBCC, strSubject, strBody, strAttachment

Have a look at the SalesLogix LAN Developer Reference (search for "QueMessage") for more information.

Cheers,
Thomas
[Reply][Quote]
Chris Burriss
Posts: 120
 
Re: How to code for sending Email ???Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 07 Sep 10 8:39 AM
If you want to send emails automatically, you can use some code like the below. Note that this doesn't go through the email client. Also, if you want to create history records in SLX, you'd need to code that as well.

'Beginning of Standalone Script

option explicit

'Email constants
Const cdoSendUsingMethod = "http://schemas.microsoft.com/cdo/configuration/sendusing"
Const cdoSendUsingPort = 2
Const cdoSMTPServer = "http://schemas.microsoft.com/cdo/configuration/smtpserver"
Const cdoSMTPServerPort = "http://schemas.microsoft.com/cdo/configuration/smtpserverport"
Const cdoSMTPAuthenticate = "http://schemas.microsoft.com/cdo/configuration/smtpauthenticate"
Const cdoBasic = 1
Const cdoSendUserName = "http://schemas.microsoft.com/cdo/configuration/sendusername"
Const cdoSendPassword = "http://schemas.microsoft.com/cdo/configuration/sendpassword"

Main

Sub Main

Dim objConfig ' CDO.Configuration
Dim strToEmailAddress ' To Address
Dim strCCEmailAddress ' CC Address
Dim strFromEmailAddress ' From Address
Dim strEmailSubject ' Email Subject
Dim strEmailBody ' Email body

' Get a handle on the config object and its fields
Set objConfig = CreateObject("CDO.Configuration")

' Set config fields we care about

objConfig.Fields.Item(cdoSendUsingMethod) = cdoSendUsingPort
objConfig.Fields.Item(cdoSMTPServer) = "smtp.server.com."
objConfig.Fields.Item(cdoSMTPServerPort) = 25

'objConfig.Fields.Item(cdoSMTPAuthenticate) = cdoBasic
'objConfig.Fields.Item(cdoSendUserName) = "XXXX"
'objConfig.Fields.Item(cdoSendPassword) = "XXXX"
objConfig.Fields.Update

strToEmailAddress = "bob@somewhere.com"
strFromEmailAddress = "SLXService@somecompany.com"
strEmailSubject = "Test Email"
strEmailBody = "Testing"
Sendmail strToEmailAddress, strCCEmailAddress, strFromEmailAddress, strEmailSubject, strEmailBody, 2, objConfig

Set objConfig = Nothing

End Sub

Function SendMail(strTo, strCC, strFrom, strSubject, strBody, msgType, objConfig)

Dim objMail

set objMail = CreateObject("CDO.Message")

set objMail.Configuration = objConfig

objMail.To = strTo
objMail.CC = strCC
objMail.From = strFrom
objMail.Subject = strSubject

if msgType = 1 then
objMail.TextBody = strBody
end if

if msgType = 2 then
objMail.HTMLBody = strBody
end if

objMail.Send

set objConfig = Nothing
set objMail = Nothing

End Function
[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): 7/6/2025 7:05:44 AM