CodeCharge Studio
search Register Login  

Visual Web Reporting

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> Tips & Solutions

 email to remote SMTP

Print topic Send  topic

Author Message
lchurch

Posts: 20
Posted: 10/09/2008, 7:54 AM

I am using a remote SMTP server that required a login to use, and experienced a Relay error, which this code solved:

'Record DISPATCH Event AfterInsert. Action Custom Code @34-73254650
' -------------------------
If ExecuteFlag And (Not ErrorFlag) Then
Dim userEmail, assignedUserEmail, taskId As String

userEmail = "username@somesite.com"

assignedUserEmail = Convert.ToString(Settings.Connection1DataAccessObject.ExecuteScalar( _
"SELECT TextEmail FROM Staff WHERE Initials='" & Convert.ToString(item.Staffid.Value)& "'"))

Dim newMessage As New System.Web.Mail.MailMessage()

newMessage.From = userEmail
newMessage.To = assignedUserEmail
newMessage.Subject = "New Dispatch!"
newMessage.Body = "Get dispatch ASAP please."
newMessage.Fields.Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
newMessage.Fields.Item("http://schemas.microsoft.com/cdo/configuration/sendusername") = ""sendusername@somesite.com""
newMessage.Fields.Item("http://schemas.microsoft.com/cdo/configuration/sendpassword") = "wlciii"
newMessage.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = 1

System.Web.Mail.SmtpMail.SmtpServer = "sendmail4.brinkster.com"
System.Web.Mail.SmtpMail.Send(newMessage)
End If
' -------------------------
'End Record DISPATCH Event AfterInsert. Action Custom Code
View profile  Send private message

Add new topic Subscribe to topic   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

Web Database

Join thousands of Web developers who build Web applications with minimal coding.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.