<script runat=server> Sub SubmitBtn_Click(Sender As Object, E As EventArgs) Dim TheMailMessage as New MailMessage Dim TheMailConnection as SmtpMail TheMailMessage.From = "XXX" TheMailMessage.To = "XXX" TheMailMessage.Subject = "Subject" TheMailMessage.Body = "Body" TheMailConnection.SmtpServer = "localhost" TheMailConnection.Send(TheMailMessage) End Sub </script>
はじめまして。Asp.netでメールを送るにはどうしたらよいのでしょうか?
スクリプト部分は…
<script runat=server>
Sub SubmitBtn_Click(Sender As Object, E As EventArgs)
Dim TheMailMessage as New MailMessage
Dim TheMailConnection as SmtpMail
TheMailMessage.From = "XXX"
TheMailMessage.To = "XXX"
TheMailMessage.Subject = "Subject"
TheMailMessage.Body = "Body"
TheMailConnection.SmtpServer = "localhost"
TheMailConnection.Send(TheMailMessage)
End Sub
</script>
みたいな感じで、TheMailMessage.Toに自分宛のアドレスを記入しているのですが、エラーは出ないものの、メールが届きません。
OSはWin2000です。かなりの初心者なんですが、どうかお力添えのほど宜しくお願いします。