cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Go to solution

Looking for Guru help on Contact Form - not sending email

I am New to coding and seeking help from the community -

 

I created 2 Files. First File is the Contact Form itself. Which calls another file using Form method = Post

 

My First page code "ContactUS.aspx" is as follows :

 

<%@ Page Language="C#" %>

<!DOCTYPE html />
<html>
<head>

</head>
<body>

<form method="POST" action="ContactProcessing.aspx">
<table align="center" class="style3">
<th colspan=2>

<span class="style18"><strong>Please complete the form and some one will get in
touch with you.</strong></span>
</th>
<tr>
<td class="style4" >

First Name:</td>
<td  > <input type="text" name="FName" style="width: 350px" />
</td>
</tr>
<tr>
<td  >

Last Name:</td>
<td  > <input type="text" name="LName" style="width: 350px" />
</td>
</tr>

<tr>
<td >

Email id:</td>
<td  > <input type="text" name="email_id" style="width: 350px" />
</td>
</tr>
<tr>
<td  >

Contact Phone Number:</td>
<td  > <input type="text" name="PhoneNo" style="width: 350px" />
</td>
</tr>

<tr>
<td  >

We are here to help please tell us your needs in few lines:</td>
<td  > <input type="text" name="ClientNeeds" style="width: 704px; height: 109px;" />
</td>
</tr>

<tr>
<td  colspan="2">
<input type="submit" value="Submit Request" /> <input type="reset" value="Clear all" />
</td>
</tr>
</table>
</form>

</body>
</html>

 

 

My SECOND page code "ContactProcessing.aspx" code is as follows :

 

@{
var FirstName = Request["FName"];
var LastName = Request["LName"];
var CustomerEmail = Request["email_id"];
var ContactPhoneNo = Request["PhoneNo"];
var CustomerNeeds = Request["ClientNeeds"];
var errorMessage = "";
var debuggingFlag = false;
try {
// Initialize WebMail helper
WebMail.SmtpServer = "smtpout.secureserver.net";
WebMail.SmtpPort =25;
WebMail.UserName = "MyUserName";
WebMail.Password = "MyPassword";
WebMail.From = "MyEmail";

// Send email
WebMail.Send(to: CustomerEmail,
subject: "Help request from - " + FirstName,
body: CustomerNeeds
);
}
catch (Exception ex ) {
errorMessage = ex.Message;
}
}
<!DOCTYPE html>
<html>
<head>
<title>Request for Assistance</title>
</head>
<body>
<p>Sorry to hear that you are having trouble, <b>@FirstName</b>.</p>
@if(errorMessage == ""){
<p>An email message has been sent to our customer service
department regarding the following problem:</p>
<p><b>@CustomerNeeds</b></p>
}
else{
<p><b>The email was <em>not</em> sent.</b></p>
<p>Please check that the code in the ProcessRequest page has
correct settings for the SMTP server name, a user name,
a password, and a "from" address.
</p>
if(debuggingFlag){
<p>The following error was reported:</p>
<p><em>@errorMessage</em></p>
}
}
</body>
</html>

===============================

 

Any help is appreciated to get this to work

 

===============================

 

 

13 REPLIES 13
Solution

Re: Looking for Guru help on Contact Form - not sending email

Solved.

 

I got this working. There was no response to my post.

 

If any one needs help in future on the topic on how to generate or send email from a form, using C#, html and ASP.NET feel free to contact amit.chattoraj at straightforwardconsultants.com for guidance. 

 

 

New

Re: Looking for Guru help on Contact Form - not sending email

Hi can you tell us how you fixed this issue. We are using SmtpClient in .net. port=25 and host = "relay-hosting.secureserver.net"

Re: Looking for Guru help on Contact Form - not sending email

What is your code trying to achieve ? Please send me some details of what you want to achieve ?

Check out the working contact us web page on my web site straightforwardconsultants dot com

 

 

 

Highlighted

Re: Looking for Guru help on Contact Form - not sending email

What is your code trying to achieve ? Please send me some details of what you want to achieve ?

New

SMTP email with third party

Hi, I have hosting with Godaddy and emails with Crazydomains. I have a form that uses SMTP however the forms don't work because Godaddy is blocking Crazydomains. How do I go about unblocking this so that Crazydomains SMTP servers work properly?

Re: SMTP email with third party

I'm having the same issue. It works when I'm debugging it but when I publish the code (using plesk, asp.net) it doesn't work. I am using sendgrid to send the email too. Not sure what else to do.

Sending emails from localhost C#

I want to configure email setting and sending from localhost for testing purpose, but getting error

The remote name could not be resolved: 'relay-hosting.secureserver.net'

 

I am using shared hosting

 

Please help

Sending mail

 i need a full php code for sending emails please.

Anonymous
Not applicable

Re: Sending mail

Hi @Ahmedsalah,

 

Go to the php website and RTM.

http://php.net

 

Write it yourself or pay a programmer!

run visual c++ redistributable on windows hosting

i need to run visual c++ redistributable 2015  on server please show me how to run it

PHP IMAP support is deactivated

I need to use the PHP IMAP support, but seems to be deactivated. Can somebody tell me how actívate it in my GodDaddy Linux Classic Hosting ?

New

php mail help with yahoo email recipients

I have a shared deluxe hosting Linux account.  I have used php mail for years on two web forms for my customers.  Recently it has come to my attention that customers that have Yahoo email addresses are not receiving mail from the forms.  After some testing that proves to be true.  I can use the forms to send to just about any other email provider.  I called GoDaddy support and the technician told me that it looks like there might be a temporary block from Yahoo on the relay server that the shared hosting account uses.  He could not tell me how long that could go on but it has already been a few days.  When I receive an email from my form it always has something like this in the from line mywebform@mydomain via xxxxx.xx.xxx.xxx.secureserver.net.  So that relay is what apparently yahoo does not like.  Right now all the technician gave me was well it might go away or I can buy another hosting account that will have a different relay that might not be blocked but it could at any time.  That does not seem like a very good solution.  I am thinking a relay through an account I own would probably make more sense.  I am just not real sure about getting that setup on a shared hosting account.  Has anybody else had this problem that could provide me with a solution or point me in the right direction?

 

Thanks,

 

Mike

Re: Looking for Guru help on Contact Form - not sending email

port 3535 works for me.

 

port 25 gives me an error.

 

Look in Godaddy workspace control center in your email account.

 

then menu Tools - EMail setup Center

 

look in email server settings - gives your proper outgoing server - mine is smtpout.secureserver.net not the relay one in other examples.