How to Create a Simple Web Form for Go Daddy hosted site from Visual Web Dev 2005 Express Edition

I have spent all weekend trying to make my simple form mail WORK.  And now, much forum hunting and Go Daddy calling later, I want to post what I have learned, hoping to save another newbie a loooooong weekend.  So here goes:

1) If you don't have one already, create an e-mail account at Go Daddy.  It will take about 15 minutes to become active.  Write down your user id and password, then forge ahead with the rest of this.  It will take you less than an hour, depending on how detailed your form is.

2) Create your form in MS VWD 2005 X ed using the Wizard tool, per the 13-minute video and free code provided at:
http://msdn.microsoft.com/asp.net/learning/learn/newtodevelopment/

 Your generic code behind page looks like this, and **needs these changes**:

Imports System.Net.Mail

Partial Class _filename

**enter the file name you gave to your form, no .aspx at the end, then confirm at the top of your form that it has this page's correct name**

    Inherits System.Web.UI.Page

    Protected Sub CustomValidator1_ServerValidate(ByVal source As Object, ByVal args As System.Web.UI.WebControls.ServerValidateEventArgs) Handles CustomValidator1.ServerValidate
        If txtComments.Text.Length > 10 Then
            args.IsValid = False
        Else
            args.IsValid = True
        End If
    End Sub

**I blew the sub above away; it was easier to just set the "maximum length" restriction for my testbox and add "100 words max" to the field description**

    Protected Sub Wizard1_FinishButtonClick(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.WizardNavigationEventArgs) Handles Wizard1.FinishButtonClick
        SendMail(txtEmail.Text, txtComments.Text)

**list ALL of the field names on you form here that you want sent to your e-mail when the form posts.  You can list more than two!  Just check that the format is right for each field and you are spelling the fields identically to how they appear in your form**

    End Sub

    Private Sub SendMail(ByVal from As String, ByVal body As String)

**This is where you can specify more form fields to return to you, by adding "ByVal Body1 As String, ByVal Body2 As String, etc., up through the number of additional fields you want returned in the e-mail.  You will get an error as soon as you add one Body# too many!**

        Dim mailServerName As String = "SMTP.MyDomain.com"

**For Go Daddy, replace SMTP.MyDomain.com with smtpout.secureserver.net**

        Dim message As MailMessage = New MailMessage(from, "scott@vertigosoftware.com", "feedback", body)

**This is the long one!  Replace "scott@vertigosoftware.com" with your Go Daddy e-mail account.  Replace "feedback" with the header you want to appear for the e-mail.  Then replace body with your formatted string.  For example:
 **Dim message As MailMessage = New MailMessage(from, "you@yourgodaddysitename.com", "This is the Subject", "Email:" + txtEmail.Text + Chr(13) & Chr(10) + "FirstName:" + txtFirstName.Text + Chr(13) & Chr(10) + "LastName:" + txtLastName.Text) will send an e-mail to your Go Daddy e-mail address, with This is the Subject as the header, and a body that looks like this:
E-Mail:Email entered on form
FirstName:first name entered on form
LastName:last name entered on form
That's because Chr(13) & Chr(10) is the command for a Windows hard return.
        Dim mailClient As SmtpClient = New SmtpClient
**a line is missing here.  Add:
        mailClient.Port = 25
**Go Daddy has multiple ports.  See if this port # works, or call Go Daddy to get additional port info. 
        mailClient.Host = mailServerName
        mailClient.Send(message)
        message.Dispose()
    End Sub

3)  Update your web.config file in the system.net section to reflect Go Daddy's smtp info and your user authentication:

    <system.net>
        <mailSettings>
            <smtp from="you@yourgodaddysite.com">
    <network host="smtpout.secureserver.net" password="your_e-mail_password" userName="you@yourgodaddysite.com" />
   </smtp>
        </mailSettings>
    </system.net>

You should have a working form at this point - I hope!  I sent Go Daddy the same links and mentioned what proprietary info they had to give to someone from the first call (rather than the third call, as in my case), so I hope this puts an end to frustrated newbies.  Happy FormMailing!  

0
dmitcha
9/6/2006 12:34:24 AM
asp.net.web-forms 93655 articles. 6 followers. Follow

3 Replies
1498 Views

Similar Articles

[PageSpeed] 15
Get it on Google Play
Get it on Apple App Store

Well done! And more so for taking the time to help your peers.

Some quick tips.

Chr(10) & chr(13) are the ASCII Codes for Carriage Return and Line Feed and are not windows specifc.

The best way to embed control chars is controlchars.crlf - try this out to view the other control characters available (Tab etc).

In your message text you are using + or & to concatenate strings. In VB.Net use & for string concatenation.

Dim message As MailMessage = New MailMessage(from, "you@yourgodaddysitename.com", "This is the Subject", "Email:" + txtEmail.Text + Chr(13) & Chr(10) + "FirstName:" + txtFirstName.Text + Chr(13) & Chr(10) + "LastName:" + txtLastName.Text) will send an e-mail to your Go Daddy e-mail address, with This is the Subject as the header, and a body that looks like this:

becomes

Dim message As MailMessage = New MailMessage(from, "you@yourgodaddysitename.com", "This is the Subject", "Email:" & txtEmail.Text & controlchars.crlf & "FirstName:" & txtFirstName.Text & controlchars.crlf & "LastName:" & txtLastName.Text) will send an e-mail to your Go Daddy e-mail address, with This is the Subject as the header, and a body that looks like this:

Happy coding.

 


Rgds,
Martin.

For the benefit of all users please mark any post answers as appropriate.
0
mokeefe
9/6/2006 1:23:00 AM

"Chr(10) & chr(13) are the ASCII Codes for Carriage Return and Line Feed and are not windows specifc."


Strictly speaking 10 and 13 are appropriate the ASCII codes.


Rgds,
Martin.

For the benefit of all users please mark any post answers as appropriate.
0
mokeefe
9/6/2006 1:24:39 AM
Cool!  Will use the embedded characters next - thanks - dma
0
dmitcha
9/6/2006 5:13:27 AM
Reply:

Similar Artilces:

Deploying a web site from Visual Web developer 2005 Express edition
Does anyone know how to deploy a web site from Visual Web Developer 2005 Express edition?...

Creating a Web Form with a multiple data tables in Visual Web Developer 2005
I just realized that I have posted this question in one of the other forums and I think it belongs in this one.I am trying to create a form where users can enter new Title information, the title header information is being stored in a table called Books. In addition to the information stored in Books I have another table called Subjects the Subjects table has the BookID in it as a foreign key, each book can have multiple subjects. Tables Books - BookID (varchar50) Primary Key - Title (varchar50) Subjects - iSubjectID (int) Primary Key auto-increment - BookID (varc...

web web web
Name: bahadir Email: sensiz_olmuyor_t1_at_hotmail.com Product: Firefox 2 Beta 2 Summary: web web web Comments: web sayfası yapmak Browser Details: Mozilla/5.0 (Windows; U; Windows NT 5.1; tr; rv:1.8.1b2) Gecko/20060821 Firefox/2.0b2 ...

The web site credated by beta 2 can not be run at Microsoft Visual Web Developer 2005 Express Edition,why?
The web site credated by beta 2 can not be run at Microsoft Visual Web Developer 2005 Express Edition,why? I have created a web with Visual Web Developer 2005 beta 2, and add three user using the tool ASP.NET Web Site Administration Tool. now I install the final Visual Web Developer 2005 Express Edition,but I find my web site can not be run in the final edition, when I try to login into system using Login control, I get the error 1 below: //--------------------------------------error 1--------------------------------------------------------Server Error in '/onlinebookmark' Application. Pr...

How to Make Web Forms from other Web Forms
In putting together an ASP.NET application for a biz application, we have come to the point where there are three different types of basic forms which have, for the most part, been perfected. Now its is a matter of cloning those forms for various uses and modifying or adding code to suit the particular need. Copy and paste works OK, but there is a lot of changing of certain words, etc. Is there a way in ASP.NET to take these basic forms, turn them into classes or templates, create forms from them, then add or overwrite code? ? (Anybody who is a Vis Fox Pro programmer would know imme...

Web forms and mobile web forms
Hey everyone, I am looking to develope a web site that depending on the device connecting to it, it will display a certain page. In this case im looking to create a web and wap version of the same project. I have the Web forms version finished using ASP.NET and C# and I am wondering how to create the mobile web form and incorporate it in the project. In the project folder, can I just add a mobile web??? But what about displaying device specific pages?? Cheers -Dudach Yes, you can add mobile web forms and controls to your Web Application project. No problem. For device/br...

Web site with Visual Web Developer 2005 Express
I am very new to .NET so please bare with me.  I am in a web development college course and we are doing are web application in ASP.NET using C#.  One of my group members came across Visual Web Developer 2005 Express and showed us how easy it makes making a web page with login features. I was looking at the FAQ for VWD 2005 Express here: http://lab.msdn.microsoft.com/express/faq/default.aspx#vwd and it has this question: Can I build and deploy applications using the Visual Web Developer 2005 Express Edition Beta 1? No. During the Beta 1 timeframe we want customers...

Creating and using a common web form for multiple web sites
Hi.  I thank you in advance for the responses. I have a common web form ( a search/result database screen) that can be used throughout multiple web sites.  What is the best way to have this web form and codefile consumed by multiple applications?   Thanks   If these are truely different sites then that will mean they will have different processes. You will probably need to put these files into a DLL for distribution to each app. The other option (there may be more but these are the only two I can think of now) would be to have these driven by a webservice and feed t...

Visual Web Developer 2005 Express Edition and Web Matrix
Hello, I am using Web Matrix with Microsoft SQL 2000 to build web sites in ASP.NET 1.1 / VB. I need to keep using Web Matrix with Microsoft SQL 2000. Can I install the Visual Web Developer 2005 Express Edition and Microsoft SQL Server 2005 Express? I would use Web Matrix with Microsoft SQL 2000 to work as I usually do. At same time I would get used to Visual Web Developer 2005 Express Edition. Thank You, Miguel VWD can coexists with Web Matrix. I am not sure, however, if SQL 2005 can run on the same box with SQL 2000. You do can, however, use VWD with SQL 2000.Thanks------...

Visual web developer 2005 express to visual web developer 2008 express
 I created a project(web site) in vwd 2005 on Win XP. Upon trying vwd 2008 on Vista home premium, and opening the project and selecting to convert to 3.5 .Net, the formatting is not correct. All images are sent way over to the right. Everything else works fine.Anybody else have this problem, or similar?TIA Този уебсайт е твърде бавен. Мисля, че IIS 7 не е конфигуриран правилно. Моля, премахнете банери по-горе. Rendering difference is not a result of conversion. 2008 designer is completely different from 2005, there is no common code. 2005 designer was based in IE6 while 2008 is b...

For interrupting.web form Resized by position of the div : if div can't dispaly all (such as only top part , then web form heithten the heght),resize the web form
Web Form Resized by position of the div : if div can't dispaly all (such as only top part , then web form heithten the heght),resize the web form ! Because of my pool English, if you can't see , I will explain more ! ThanksGambler is the real life I guess you mean when form grows it also grow parent div element. This is normal. If you want div to stay fixed size and rather clip the form and maybe show a scrollbar, look at overflow property in CSS.Thanks------------------------------------------------------------This posting is provided "AS IS" with no warranties, and confers no ...

How to fire events in other web form from other web form ?
Suppose that I have A and B web form. I want to trigger B web form's Page_Load event from A web form. How can I do that ? Thanks in advanced WilbertWilbert Bujn Create a public method in B that call the load method : public void Load(object sender, System.EventArgs e) { Page_Load(sender, e) ; } In the page_load of A, instanciate a B object and then call the function B myB = new B() ; myB.Load() ; Quicky Thank you quicky, it works fine. WilbertWilbert Bujn...

Web Form embedded in another Web Form
Hi,  I have programmed a Web Form which acts like a scientific calculator. I would like to embedd this calculator in the upper left hand corner of another accounting Web Form. I don't want to host the calculator on the same server as the accounting page. I.e. I want them to have distinct URLs. Classically, I would do this using frames, but is there a better way using ASP? Is there some sort of Panel which can display the webpage at a specific URL which I can just drag onto my accounting Web Form? Thanks,  P1000   Frames are the only way to embed a webform inside ano...

calling a web form from another web form
I would like to know what is the best way to open a web form from another web form. I would like to call it from a button control. Thanks Well, if I've grasped your question right, there are many methods to do that: 1)Response.Redirect > To navigate to another page from code and is equal to clicking a hyperlink. I suggest this as I think it's closer to your question. 2)Server.Transfer > This ends the current web form and begins a new web form. It's usable when you want to pass some variables i.e (Label1.Text) to the next immediate page. It's not safe though and not used to send p...

Web resources about - How to Create a Simple Web Form for Go Daddy hosted site from Visual Web Dev 2005 Express Edition - asp.net.web-forms

The Indian Express: Latest News, Breaking News Live, Current Headlines, India News Online
Indian Express covers latest news from India, all exclusive current headlines and India news live, including latest breaking news on business, ...

Local news, sports, obituaries, classifieds and more - Tallmadge Express
NEWARK, N.J. (AP) Gov. Chris Christie, who once famously called himself "the healthiest fat...

Sussex Express
Search continues for boy swept out to sea at... The search has continued today (Monday October 28) for the 14-year-old local boy who was swept ...

Outlook Express - Wikipedia, the free encyclopedia
Mac OS 9 ,, Windows 3.x , Windows NT 3.51 , Windows 95 , Windows NT 4.0 Outlook Express is an email and news client that is included with Internet ...

Jakartans express defiance and return to work after terror attacks
It's business as usual in Indonesian capital after Thursdays terror attacks.

Fred Armisen in his feminist bookstore persona Candace Devereaux reads "Portlandia Travelogue: The Brussels ...
Downloadable free here . A literary train journey on the Brussels to Antwerp Express through the erotic world of European train stations and ...

Walmart Closing 154 Stores In U.S., Ending “Walmart Express” Experiment
Walmart’s five-year dalliance with trying to go small through new “Walmart Express” stores is apparently over. This morning, the company announced ...

Jackson Hewitt Teams Up With American Express To Target The Underbanked This Tax Season
... and underbanked, taxpayers who have their taxes prepared at Jackson Hewitt can opt to have their federal tax refund added to an American Express ...

Siberian Express Expected to Send Temperatures Plummeting
Siberian Express Expected to Send Temperatures Plummeting

Meet Uman, The Gender Fluid Artist Who Taught Herself To Express
Born in Somalia and raised in Kenya in a Muslim household, Uman is redefining outsider art in NYC.

Resources last updated: 1/17/2016 1:29:32 PM