Ciao,
sono un novizio in ambito asp.net,
mi serve realizzare un modulo per l'invio di e-mail,
nella rete ho trovato questo codice:
codice:
<script language="vb" runat="server">
Sub btnSendFeedback_Click(sender as Object, e as EventArgs)
'Create an instance of the MailMessage class
Dim objMM as New MailMessage()
'Set the properties - send the email to the person who filled out the
'feedback form.
objMM.To = "info@miosito.it"
objMM.From = txtEmail.Text
'Send the email in text format
objMM.BodyFormat = MailFormat.Text
'(to send HTML format, change MailFormat.Text to MailFormat.Html)
'Set the priority - options are High, Low, and Normal
objMM.Priority = MailPriority.Normal
'Set the subject
objMM.Subject = "4GuysFromRolla.com - Feedback"
'Set the body
objMM.Body = "At " + DateTime.Now + " feedback was sent from an ASP.NET " & _
"Web page. Below you will find the feedback message " & _
"send by " & txtName.Text & "." & vbCrLf & vbCrLf & _
"---------------------------------------" & vbCrLf & vbCrLf & _
txtMessage.Text & vbCrLf
'Specify to use the default Smtp Server
SmtpMail.SmtpServer = ""
'Now, to send the message, use the Send method of the SmtpMail class
SmtpMail.Send(objMM)
panelSendEmail.Visible = false
panelMailSent.Visible = true
End Sub
</script>
<html>
<body>
<asp:panel id="panelSendEmail" runat="server">
<form id="Form1" runat="server">
<h2>Contatti</h2>
Nome:
<asp:textbox id="txtName" runat="server" />
Indirizzo Email:
<asp:textbox id="txtEmail" runat="server" />
Messaggio:
<asp:textbox id="txtMessage" TextMode="MultiLine"
Columns="40" Rows="10" runat="server" />
<asp:button runat="server" id="btnSendFeedback" Text="Send Feedback!"
OnClick="btnSendFeedback_Click" />
</form>
</asp:panel>
<asp:panel id="panelMailSent" runat="server" Visible="False">
</asp:panel>
</body>
</html>
ma quando uplodo la pagina, il modulo contatti non appare proprio!
come posso fare??
a presto