Click here to Skip to main content
15,886,014 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
Hello,
how user sends fedback to admin .
user fills some textboxes as name, emailid, contact, then user presses the button and sends feedback to admin in mail. how it is done ?
i am confused in mail function. it is not working
Posted

Try a simple search on google[^], which gives you about 1,830,000 results.

Also check on CP Search[^], for more similar threads.
 
Share this answer
 
Function For Sending Email
VB
Public Sub sendEmail(ByVal Recip As String, ByVal Subj As String, ByVal Msg As String, _
                     ByVal FromAdd As String, ByVal Pass As String, ByVal SMTP_Host As String, _
                     ByVal SMTP_Port As Integer)

 Try
            Dim SmtpServer As New System.Net.Mail.SmtpClient()
            Dim mail As New System.Net.Mail.MailMessage()

            SmtpServer.EnableSsl = True
            SmtpServer.Credentials = New  _
            Net.NetworkCredential(FromAdd, Pass)
            SmtpServer.Port = SMTP_Port
            SmtpServer.Host = SMTP_Host
            mail = New System.Net.Mail.MailMessage()
            mail.From = New System.Net.Mail.MailAddress(FromAdd, "Test Message")
            mail.To.Add(Recip)
            mail.IsBodyHtml = True
            mail.Subject = Subj
            mail.Body = Msg
            SmtpServer.Send(mail)
            MsgBox("Mail Sent!", MsgBoxStyle.Information, "Sent")

        Catch ex As Exception
            MsgBox(ex.ToString)
        End Try
end sub
 
Share this answer
 
v3
Comments
Jasbeer Singh 27-Sep-12 3:29am    
Net.NetworkCredential(FromAdd, Pass)
what is frmAdd and password,

which password ?
xErvender 27-Sep-12 11:09am    
Recip = Recipients
Subj = Subject
Msg = Message
FromAdd = From(ur gmail account)
Pass = Password
Jasbeer Singh 29-Sep-12 1:41am    
error : Server does not support secure connections.
xErvender 29-Sep-12 9:43am    
use gmail acc..and use gmail server..

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900