GY
|
Posted: 04/10/2005, 2:45 AM |
|
Dear all
Can anyone post the Asp.NET code as per captioned as the PORTAL solution's Register page hasn't this function
Thanks in advance
|
|
|
rclayh
Posts: 8
|
Posted: 04/11/2005, 7:19 AM |
|
Here's a code snippet I use. It's been genericized but maybe it will help. I stick this in the AfterInsert event of my form but you may want to put it someplace else.
If Table2ProblemDescription.Text.Trim().Length > 0 Then
Dim message As System.Web.Mail.MailMessage = New System.Web.Mail.MailMessage()
message.From = "you@yourdomain.com"
message.To = "youruser@theirdomain.com" 'OR Use FORM VALUE
message.Subject = "NEW HELP DESK CALL - " & Table2CurrentUser.Value.ToString()
message.Body = Table2CurrentUser.Value.ToString & " - " & Table2ProblemDescription.Text & vbCrLf & vbCrLf
message.BodyFormat = System.Web.Mail.MailFormat.Text
System.Web.Mail.SmtpMail.SmtpServer = "MYSMTPSERVER"
System.Web.Mail.SmtpMail.Send(message)
Else
ErrorFlag = True
Table2Errors.Add("", "Fields 'From' and 'To' are required")
End If
|
|
|
|