PDA

View Full Version : emailing from a site.



viper5646
25 Sep 2010, 05:47 PM
Hi all
I'm designing my first website using VS pro.
On my contacts form I have a Name, Email, Subject and Message Textbox.
I'm tryng to send an email using the data in the textboxes.
I keep on getting the following error: Command not implemented. The server response was: Command not implemented
I belive that Im missing the smtp port for Yahoo.mail which I don't know how to set up port 465.
This is the code I have behind the sent button.


Protected Sub btnsend_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnsend.Click
Dim mail_to As String = "delta5646@yahoo.com"
Dim mailmessage As System.Net.Mail.MailMessage = New System.Net.Mail.MailMessage()
mailmessage.From = New System.Net.Mail.MailAddress(txtemail.Text.Trim())
mailmessage.To.Add(New System.Net.Mail.MailAddress(mail_to.Trim()))
mailmessage.Subject = txtsubject.Text.Trim()
mailmessage.Body = txtmessage.Text.Trim()
Dim smtpClient As System.Net.Mail.SmtpClient = New System.Net.Mail.SmtpClient()
smtpClient.EnableSsl = True
smtpClient.Send(mailmessage)
End Sub

I also made these additions on the web.config


<system.net>
<mailSettings>
<smtp>
<network host="smtp.mail.yahoo.com"/>
</smtp>
</mailSettings>
</system.net>
Thank you