Send Mail

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • =?Utf-8?B?SmFtZXMgUm9iZXJ0c29u?=

    #1

    Send Mail

    I have a form that users type in information into. It then e-mails the
    specified user below. What I am looking for is how can I e-mail a carbon
    copy of this same informtaion back to the user at TXTEMail.Text when the user
    clicks my SEND button. I removed unnecessarry code.

    My thought was to add a new DIM EMAILCC = TXTEMail.Text
    then add (from, emailto, ,emailcc, subject,
    But that failed with a "Overload resolution failed because no accessible
    'New' accept this number of arguments."

    So without rewriting my code any help?

    PS yes I am new to writing code.

    CODE

    Imports System.Net.Mail

    Partial Class _Default
    Inherits System.Web.UI.P age

    Protected Sub Wizard1_FinishB uttonClick(ByVa l sender As Object, ByVal e
    As System.Web.UI.W ebControls.Wiza rdNavigationEve ntArgs) Handles
    Wizard1.FinishB uttonClick
    SendMail(TXTNam e.Text + " " + "<" + TXTEMail.Text + ">", TXTBOX1.Text)
    End Sub

    Private Sub SendMail(ByVal from As String, ByVal subject As String,
    ByVal body As String)
    Dim mailServerName As String = "name.servernam e.org"
    Dim emailto = "servername@ser vername.org"
    Dim message As MailMessage = New MailMessage(fro m, emailto, subject,
    body)
    Dim mailClient As SmtpClient = New SmtpClient
    mailClient.Host = mailServerName
    mailClient.Send (message)
    message.Dispose ()
    End Sub
    End Class

Working...