Signup · Login
Stardeveloper.com  
Home · Tutorials · Forums · ASP.NET Newsletter Application · Web Hosting Plans · Faisal Khan's Blog · Contact
Forums : .NET : ASP.NET : Email validation Signup · Login
Author Thread
Email validation
Posted in tutorial: Creating an ASP.NET Newsletter Application
·  beeby
User
Joined: 14 Oct 2009
Total Posts: 4

Email validation

Posted: 14 Oct 2009
I've setup the newsletter system. However, when I get the email with link to validate my email and click the link it does not update the fields in the Subscribers table in the database to show the address as validated. Is there something I have missed?
·  cristikiss88
User
Joined: 27 Oct 2009
Total Posts: 5
Re: Email validation
Posted: 27 Oct 2009
Hello,

Have you ever figure out how to make that procedure work? I have the same problem like you, and i can't figure it out.Thanks.

Best!
·  beeby
User
Joined: 14 Oct 2009
Total Posts: 4
Re: Email validation
Posted: 27 Oct 2009
I haven't sorted it no. As a work around you can setup a job to update all email addresses to be validated but this of course defeats the whole point of having the validation system. Not had chance to look at the cause or got a reply from anyone.

Good that you get it too, means it is unlikely to be something I did wrong.

If I find the answer I will update this thread.
·  cristikiss88
User
Joined: 27 Oct 2009
Total Posts: 5
Re: Email validation
Posted: 27 Oct 2009
Thank you for your answer. I think that tomorrow i will have a look again on it and i hope i will figure it out. If so i will post here the fix.

Best!
·  ameng222
User
Joined: 12 Nov 2009
Total Posts: 3
Re: Email validation
Posted: 12 Nov 2009
Hi,
At last I got it after trying it for hours.
Just change the table name in DatabaseHelper.cs from [dbo].[IsSubscriberEmailValidated] to [dbo].[ValidateEmail] and the problem solved.

Good Luck.

########### DatabaseHelper.cs ###################
......
......
public static int ValidateEmail(SqlConnection con, SqlTransaction trans,
string email, int validationCode)
{
using (SqlCommand cmd = new SqlCommand("[dbo].[ValidateEmail]", con))
{
cmd.CommandType = CommandType.StoredProcedure;

cmd.Parameters.Add("@email", SqlDbType.VarChar, 50).Value = email;
cmd.Parameters.Add("@validationCode", SqlDbType.Int).Value = validationCode;
cmd.Parameters.Add("ReturnValue", SqlDbType.Int).Direction = ParameterDirection.ReturnValue;

if (trans != null)
cmd.Transaction = trans;

cmd.ExecuteNonQuery();

return Convert.ToInt32(cmd.Parameters["ReturnValue"].Value);
}
}
.....
.....
################################################
·  cristikiss88
User
Joined: 27 Oct 2009
Total Posts: 5
Re: Email validation
Posted: 13 Nov 2009
Thanks for your reply. I have changed the newsletter functionality to support html enabled e-mails.

Thanks anyway!
·  beeby
User
Joined: 14 Oct 2009
Total Posts: 4
Re: Email validation
Posted: 13 Nov 2009
How did you change it to work with HTML???

Thanks to the poster that suggested the fix, I will try it out.
·  ameng222
User
Joined: 12 Nov 2009
Total Posts: 3
Re: Email validation
Posted: 13 Nov 2009
Hi beeby,<br /><br /> I'm also change it to work with HTML.<br /><br /> I'm using Cute Editor for .NET and emmbed in to the code. You can see the installation guide from Cute Editor site. And to make it be able to view correctly from database just add msg.IsBodyHtml = true; in the JobRunner.cs file..<br /><br />That is what I did.
Maybe others got better ideas.
·  cristikiss88
User
Joined: 27 Oct 2009
Total Posts: 5
Re: Email validation
Posted: 13 Nov 2009
If you want to use the same functionality as before make the changes that amenq222 suggested down. I have changed that functionality a little bit, because i didn't need some of it, but instead i needed something new.
·  beeby
User
Joined: 14 Oct 2009
Total Posts: 4
Re: Email validation
Posted: 13 Nov 2009
Excellent! Thank you so much

I seem to have another issue though. I create a job email and it goes into database but does not appear in the manage prepared emails section or the list of prepared emails when I add a job. Anyone else get this issue? what have I missed?
·  ameng222
User
Joined: 12 Nov 2009
Total Posts: 3
Re: Email validation
Posted: 16 Nov 2009
I'm not sure about that. But you can try this:
- You have to click add job, when you finished creating the email. OR
- Make sure you database is connected when you create email. OR
- Make sure you already creating the database correctly (tables and stored procedure). OR
- Reinstall back the application(last choice).

Just my 2 cents suggestion.
·  chaitu12_run
User
Joined: 7 Jan 2010
Total Posts: 3
Re: Email validation
Posted: 14 Jan 2010
I tried it mate but it was giving an output error

during the execution it is giving an exception

The formal parameter "@validationCode" was not declared as an OUTPUT parameter, but the actual parameter passed in requested output.

can any one please help me
·  chaitu12_run
User
Joined: 7 Jan 2010
Total Posts: 3
Re: Email validation
Posted: 14 Jan 2010
Can give it in details please it is hard to follow can you help me out here
·  Faisal Khan
AdminAdminAdminAdmin
Joined: 24 Sep 2002
Total Posts: 595
Re: Email validation
Posted: 15 Jan 2010
Can you please elaborate what you tried when you got that error?

Faisal Khan.
Stardeveloper.com
Read Blog | Follow on Facebook, Twitter
·  chaitu12_run
User
Joined: 7 Jan 2010
Total Posts: 3
Re: Email validation
Posted: 15 Jan 2010
when i submit the email for subscription it is not validating the email. The value in Validate code is 0. Then it shows the execution error as we follow the hyperlink for validation.

it gives out the msg as

Your email address is already in our database but it has not been validated yet. If you will like a validation email sent to this email address again then (click here).

It follows to the error.

Can you help me Plz

Want to leave a comment? Login or Register for free!

Users Subscribed To This Thread
Faisal Khan   beeby   cristikiss88   ameng222   chaitu12_run  

Users Who Have Visited This Thread In Last 24 Hours
3 Visitors

Login to post a comment or start a new thread
UserName Or Email Address:       Password:       Auto-Login:    
· Create New User Account
· Send Forgotten Password by Email
 
© 1999 - 2010 Stardeveloper.com, All Rights Reserved.