Website "Email Feedback Form" (ASP.NET)--Quick Help Needed :(

M

Mindful_Spirit

I'm trying to set up a basic email feed back form
like
this
, and was wondering about some basic configuration settings. I
have used code from
this
website
. I have it working just fine. I'm running IIS on my home
machine.

My problem is that I need to upload this stuff to a webhosting place and
register a domain and I'm not sure what to put as the smtp mail server value
in this script??

Currently I am with the Optusnet ISP and thus for the SMTP server i put

SmtpMail.SmtpServer = "mail.optusnet.com.au"

and then up towards the top of the script I have the contents of the form to
be sent to the following email address,

objMM.To = "(e-mail address removed)"

My question is, what value to I put for SmtpMail.SmtpServer, when
I upload this website to some webhosting place? Do I just put it as
mail.webhostingplace.com.au or how do you know what to put for the SMTP
server?


I know this is basic and that many of you would have done it a million times
before but I just don't know the answer to this and noone seems to be able
to give me a straight answer.

Any help would be greatly appreciated. See the script below for what I'm
currently using and working on my home machine running IIS.


<%@ Page Language="vb" Debug="true" %>
<% @Import Namespace="System.Web.Mail" %>
<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 = "(e-mail address removed)"
objMM.From = txtEmail.Text

'If you want to CC this email to someone else, uncomment the line below
'objMM.Cc = "(e-mail address removed)"

'If you want to BCC this email to someone else, uncomment the line below
'objMM.Bcc = "(e-mail address removed)"

'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 = "Redlands Cricket Academy - 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 = "mail.optusnet.com.au"

'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 runat="server">
<h2>We are interested in your feedback! Please enter the following
requested information below to send us your comments.</h2>

<b>Your Name:</b>
<asp:textbox id="txtName" runat="server" />
<br>

<b>Your Email Address:</b>
<asp:textbox id="txtEmail" runat="server" />
<p>

<b>Your Message:</b><br>
<asp:textbox id="txtMessage" TextMode="MultiLine"
Columns="40" Rows="10" runat="server" />
<p>

<asp:button runat="server" id="btnSendFeedback" Text="Send Feedback!"
OnClick="btnSendFeedback_Click" />
</form>
</asp:panel>


<asp:panel id="panelMailSent" runat="server" Visible="False">
An email has been sent to the email address you specified. Thanks!
</asp:panel>
</body>
</html>
 
J

J. Alan Rueckgauer

Mindful_Spirit said:
I'm trying to set up a basic email feed back form
like
this
, and was wondering about some basic configuration settings. I
have used code from
this
website
. I have it working just fine. I'm running IIS on my home
machine.

My problem is that I need to upload this stuff to a webhosting place and
register a domain and I'm not sure what to put as the smtp mail server value
in this script??
[snip]

The general practice for ASP.Net hosts here in the US is for them to
configure CDO on the server to automatically use their SMTP server so all
you have to do is:

dim objMail as new CDO.Message
with objMail
.Sender = strMsgFrom
.To = strMsgTo
.Subject = strMsgSubject
.TextBody = strMsgText
.Send
end with

I would avoid using a host that requires you to establish and maintain your
own CDO config for apps that don't have a specific configuration
requirement. Ask the hosting company to point you to the "how-to"
references in the support section of their website where using CDO and other
permission/authentication configuration issues are explained. If they don't
have such an area, go elsewhere.
 
M

Mindful_Spirit

Thanks for the advice J. Alan Rueckgauer, I'll do exactly that :)



J. Alan Rueckgauer said:
Mindful_Spirit said:
I'm trying to set up a basic email feed back form
like
this
, and was wondering about some basic configuration settings. I
have used code from
this
website
. I have it working just fine. I'm running IIS on my home
machine.

My problem is that I need to upload this stuff to a webhosting place and
register a domain and I'm not sure what to put as the smtp mail server value
in this script??
[snip]

The general practice for ASP.Net hosts here in the US is for them to
configure CDO on the server to automatically use their SMTP server so all
you have to do is:

dim objMail as new CDO.Message
with objMail
.Sender = strMsgFrom
.To = strMsgTo
.Subject = strMsgSubject
.TextBody = strMsgText
.Send
end with

I would avoid using a host that requires you to establish and maintain your
own CDO config for apps that don't have a specific configuration
requirement. Ask the hosting company to point you to the "how-to"
references in the support section of their website where using CDO and other
permission/authentication configuration issues are explained. If they don't
have such an area, go elsewhere.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,756
Messages
2,569,540
Members
45,025
Latest member
KetoRushACVFitness

Latest Threads

Top