I cannot get my C#.NET Email Form to work on Godaddy hosting account. Please Help!!!!



I have created a contact us page and I am using .NET Mail classes to send the form via email. However I keep getting this error when I upload my info to the hosting server...

Request for the permission of type 'System.Net.Mail.SmtpPermission, System, Version=, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.

Oh and yes, it wont send any emails.

here is my code...

using System;

using System.Data;

using System.Configuration;

using System.Collections;

using System.Web;

using System.Web.Security;

using System.Web.UI;

using System.Web.UI.WebControls;

using System.Web.UI.WebControls.WebParts;

using System.Web.UI.HtmlControls;

using System.Net.Mail;

using System.Net;

public partial class ContactUs : System.Web.UI.Page


protected void Page_Load(object sender, EventArgs e)



public bool SendEmail(string strToAddress, string strCompany, string strName, string strAddress, string strCity, string strState, string strZip, string strPhone, string strAboutUs, string strComment)


bool bSuccess = false;



MailMessage oMessage = new System.Web.Mail.MailMessage();




//Email.Subject = "Quote from TravelExpress";

oMessage.Body =


"Name =" + strName + "\n\r" +

"Company =" + strCompany + "\n\r" + "Address =" + strAddress + "\n\r" + "City =" + strCity

+ "\n\r" + "State =" + strState + "\n\r" + "Zip =" + strZip + "\n\r" + "Phone =" + strPhone + "\n\r" +" Email: " + strToAddress + "\n\r"

+ "How did you hear about us: " + strAboutUs + "\n\r" + " Comments: " + strComment;


// Send the mail message

oMessage.From = ConfigurationManager.AppSettings["EmailFrom"].ToString();

oMessage.To = "info@transexpressusa.com";

oMessage.Subject = "Quote";

//SmtpClient mSmtpClient = new SmtpClient("relay-hosting.secureserver.net",3535);

//mSmtpClient.Credentials = new NetworkCredential(ConfigurationManager.AppSettings["EmailFrom"].ToString(), ConfigurationManager.AppSettings["EmailPassword"].ToString());

//mSmtpClient.Send(ConfigurationManager.AppSettings["EmailFrom"].ToString(), "info@transexpressusa.com", "Quote", strBody);

System.Web.Mail.SmtpMail.SmtpServer = "smtpout.secureserver.net";


bSuccess = true;


catch (Exception ex)


lblmessage.Text = ex.Message;


return bSuccess;


protected void btnSubmit_Click(object sender, EventArgs e)


SendEmail(txtEmail.Text, txtCompany.Text, txtName.Text, txtAddress.Text, txtCity.Text, ddlState.SelectedItem.Text, txtZip.Text, txtPhone.Text, ddlAboutUs.SelectedValue, txtComment.Text);









10/24/2008 5:00:58 PM
asp.net.getting-started 91979 articles. 4 followers. Follow

2 Replies

Similar Articles

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



This post suggests you are using the wrong smtp server from GoDaddy.

"Sector clear"
10/24/2008 5:52:20 PM

Thanks Big Smile

10/27/2008 2:48:55 AM

Similar Artilces:

using relay-host.secureserver.net & getting email on gmail and yahoo account but not getting it on my godaddy account
using smtp server address as relay-host.secureserver.net getting email on gmail and yahoo account but not getting it on my godaddy account. Please help me out, ...

Type.GetType does not work in VB.NET but works in C#. VB.NET gurus Please help
Friends,   I am an experienced C# programmer who is working on a VB.NET project now. I am writing different methods covering the following functionalities 1) Take a datareader as input and return an arraylist of class object2) Take an xmlnode (received from a webservice) as input and return an arraylist of class object. The methods are generic methods which take datareader/xmlnode as first parameter and classname (string) as the second parameter. This way it will work trivially. The schema of class object matches with the input (datareader or xmlnode)In C# I used to do th...

Developed C#.net WebService 1.1 for Client C#.net 1.1. Getting error "Server was unable to process the Request" Pls Help
Hi., I developed Microsoft C#.net Web Services2003 for the Client Application C#.net 2003. When it runs in 5 machines it gives good performance and has no errors. But if i run the same application in about 80 client machines. Getting error "Server was unable to process the request". I use Sql Server 2005 as my database. I get error even when i login at a time for about 25 users. Tried modifying machine.config too. But went unsuccessful. Live Server is 2003 using IIS 6.0 I use very expensive data handling.  Its very urgent pls help. Have to post in Live Server. Thank u., ...

Please help me to read .msg file from c#.net (urgent)and get to, subject cc, bcc property
hai,i have one folder called BTCCEmailQueue where i have <1000 .msg outlookfile and i have to read it one by one  and extract To,subject,bcc,cc ofthat particular one .how can i perform this task.byfijo______________________________________________This is the way i had created and saved .msg file//method which i use to save as .msg file   private void button1_Click(object sender, EventArgs e)        {            OMsg =(Microsoft.Office.Interop.Outlook._MailItem)OO.CreateItem(OlItemType....

How to get MVC.NET to work on shared host?
Hi, I am not sure what I need to tell my host in order to run an MVC.NET application on their server. I tried simply publishing it, but I got an error. My host support said to simply change the version to in the web.config file. I tried this and this did not work. I was told by my host that .NET 3.5 was installed. I am not sure what to tell them to do in order to allow MVC.NET applications to run. Thanks in advance   They'll need to download and install the asp.net extentions.http://www.asp.net/downloads/3.5-extensions/ However, it's likely ...

Need help getting a form to work please
Hi,I am essentially a comnplete novice at web programming - I am building a website using a template downloaded from MS as a starting point and then playing with the html and css until it works as I want it!I am trying to integrate RomanCart into a website I am bulding with Visual Studio Express.The theory is that having created some product info on the online cart, it generates some code that I can simply cut and paste into my website.My problem appears to be that it generates an html form and the application I am building is a .aspx app that needs me to have server side code to generate ...

used a c#.net to vb.net converter and am now getting a syntax error.
ok I used a cool utility at http://www.kamalpatel.net/ConvertCSharp2VB.aspx to convert some c#.net to vb.net and it spit out a bunch of code which almost works but I am getting a syntax error on this line Imports (StreamReader sr = Shadows Function)() As StreamReader(objResponse.GetResponseStream()) I tried it that way and also like Imports (StreamReader sr = Shadows Function)() As StreamReader(objResponse.GetResponseStream()) but either way gave the same error Compiler Error Message: BC30035: Syntax error. Source Error: Line 26: Line ...

how to get C# and vb.net code to work together
we have an application at work that uses vb.net code quite a bit... however i only found one article regardnig implementing active directory authentication and authorization written in c# i know its possible, how do i add in the C# code into my existing vb.net app? You can compile the C# code into an assembly and add the dll to your bin directory of the VB project and add a reference to it. Or you can just setup a C# project in your VB.NET solution, and set a project reference to it from your VB project. Darrell Norton, MVPDarrell Norton's BlogPlease mark this post as answered...

Please help me with a form/calculator that I cant get to work.
Hello, I am new here, and have come in desparation. I am rebuilding a site for a friend, they wanted it to be a copy of their original site but under their own web address. My problem is I have absolutely no idea how to get the fee calculator to work, all the rest of the site is complete. Here is the original site with the fee calculator on it: http://www.prophetdatasystems.com.au/regent/FeeCalc.asp and here is the newer version of the site: http://www.regentsettlements.com.au/feecalculator.html   I realise I will have to change the file extension of my page to .asp, but thats abo...

i am C newbie, help please, i am trying to get this too work.
hi all, I want to be able to call perl from c (eg Win32::GuiTest::FindWindowLike) and get this working.....basically capturing hwnd handles of open windows and printing them. thanks in advance, regards, Jeremy A. my code is below. -------------------------------------------------------------------------------------------- use Win32::GuiTest qw/FindWindowLike GetWindowText ShowWindow/; use Inline C; sub FWL { my ($zero,$class,$subclass); return FindWindowLike($zero,$class,$subclass); } set_callback("$main::FWL"); this_test(); __DATA__ __C...

vb.net code works but not c# code
Hello, I'm trying to insert the metatags dynamically. The following vb code works fine: aspx.vb code: Protected myTag As System.Web.UI.HtmlControls.HtmlGenericControl Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load myTag.Attributes("content") = "test" End Sub In aspx file head: <meta id="myTag" runat="server" /> The above code is working great. But the same thing I'm trying to put in C# which is not working. aspx.cs code: ...

Sending SMS using vb.net or C#.net using vb.net or c#.net
Hi  My requirement is I hav one csv file with these fields id,mobilenum,messgae,status.intiallu staus is 0. once i read the all fileds and take that mobile number.using tat mobile number  i need to send sms .after sending sms i shuld change status as 1 How to send sms thru coding (please dont provide any links.if it is provide also please give working links becox i checked codeproject .i didnt get any nice link. and also provide the how to update the status field im csv file   Thank ssandhya   To send SMS, you need some third party SMS providers. if you consul...

getting start with vb.net and crystal repots(web form)
I use Crystal Report9 in Visual Studio.NET 2003..... Example at Northwind database I want a application that.....a form include a combobox that contain CustomerID.....If I choose one CustomerID and click OK button....a Report will display information about this Customer......I think that must use Paramater.....how to do that ???? (How do I start to coding --please step by step or sample) please help me !!! Thank you so much!!! very good I have Dropdownlist when I choose the 'month'--> the all data of this field will show I use this Private Sub ddlMonth_Sel...

Get help from VB.NET & C# syntax convertion
Anyone can help to convert below C# code to VB.NET ASAP, thanks! string speechServer = ConfigurationSettings.AppSettings["SpeechServer"]; Param param = new Param(); param.Name = "server"; param.Value = speechServer; Prompt1.Params.Add(param);   Here's the VB.NET conversion: Dim speechServer As String = ConfigurationSettings.AppSettings("SpeechServer") Dim param As New Param()param.Name = "server"param.Value = speechServer Prompt1.Params.Add(param)Ryan OlshanASPInsider | Microsoft MVP, ASP.NEThttp://ryanolshan.comHow to ask a question Also you can use Kamal's C# to...

Web resources about - I cannot get my C#.NET Email Form to work on Godaddy hosting account. Please Help!!!! - asp.net.getting-started

Help - Wikipedia, the free encyclopedia
United States Senate Committee on Health, Education, Labor and Pensions , commonly abbreviated "H.E.L.P." Text is available under the Creative ...

Help:Contents - Wikipedia, the free encyclopedia
Templates are special pages that contain boilerplate text intended to be displayed on more than one page in Wikipedia. This Tip of the day box ...

Help cover the cost of Carson Palmer's fine
When Andre Ellington raced 48-yards to the end zone in Seattle Sunday, cementing the Arizona Cardinals' victory over the Seahawks, we reacted. ...

The tech wizard who helped Obama get reelected thinks we need to do more to help hacker kids
... forums and entertained himself by messing around with code as part of his self-confessed "punkness." He now credits that experience with helping ...

The Walking Dead: Here's Who Actually Called For Help
... surprised with The Walking Dead moving forward, don’t read ahead. For everyone else, here's who was on the other end of that call for help. ...

Customer Service Secrets For Millennial Customers, That Help You Serve Boomer Customers Too
Want to succeed in building a superior customer service experience for customers of all ages? Start by learning the new customer service principles ...

Handgun Jams After Man Wounds Student Trying to Help Crime Victim
(CNN) A man who tried to help a New Orleans crime victim was shot in the stomach and would have been shot again had the assailant's handgun ...

Some University of Missouri students want to help choose school's next chancellor, president
Some University of Missouri students want to help choose school's next chancellor, president

Texas Gov. Orders Humanitarian Nonprofits To Ignore Syrian Refugees in Need of Help
After Texas Gov. Greg Abbott announced that his state was not accepting people fleeing war and violence, he’s now ordered humanitarians to stop ...

Tulane Med Student Shot Trying to Help Woman
The student is expected to make a full recovery, according to Tulane.

Resources last updated: 11/23/2015 2:33:33 AM