dineshkummarc / DashboardX2.0

A Sequel Named DashboardX2.0 (https://github.com/dineshkummarc/DashboardX2.0) to the DashboardX (https://github.com/dineshkummarc/DashboardX). this code is only the folder architecture of source code and this project is not updated herein in as this project is a closed source project copyrighted by dineshkummarc and/or denno-secqtinstien. P.S. the issues for this organisation or Projects are not closed else are only marked as Fixed. so if you see the open issues in the list donot hesitate to see the list of fixed issues in the list as well. because these are the count for the resolved features in the project. Hence Download and fork is not Recommended for this Repo.
https://github.com/dineshkummarc/DashboardX
0 stars 0 forks source link

ec.co.in/corporate/tellfriend.aspx gives server error in '/' application #43

Open dineshkummarc opened 11 years ago

dineshkummarc commented 11 years ago

ec.co.in/corporate/tellfriend.aspx gives server error in '/' application

servererror

dineshkummarc commented 11 years ago

The specified string is not in the form required for an e-mail address. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.FormatException: The specified string is not in the form required for an e-mail address.

Source Error:

Line 150: msg.From = new MailAddress("khaledaparveen11@gmail.com");

Line 151:

Line 152: msg.To.Add(new MailAddress("txtEmail.Text"));

Line 153:

msg.To.Add(new MailAddress("txtEmail.Text"));

is the problem. txtEmail.Text is not an e-mail address. If that's a text file that's a list of e-mails, you're going to need to open it and read it and pass them in one by one.

If it's referring to a textbox, take the quotes around it off. Like this:

msg.To.Add(new MailAddress(txtEmail.Text));

share|improve this answer

answered Jan 21 '11 at 9:03 ajma 4,09612353

up vote 2 down vote

For me, the problem was using semi-colon(;) to seperate multiple emails. Once I change it to comma(,) it works. Hope this helps someone. share|improve this answer

answered Jan 20 '12 at 14:35 chodae 311

This was the issue for me, thank you. – Andrew Uricchio May 2 at 16:01 up vote 2 down vote

The issue on the code above might have occured due to

msg.To.Add(new MailAddress("txtEmail.Text"));

You might be clear that here "txtEmail.Text" appears as a string but not the mailing address to whom the mail is to be send. So code should be replaced with

msg.To.Add(new MailAddress(txtEmail.Text));

and sometimes the error like "The specified string is not in the form required for an e-mail address" might also occur due to use of improper string.As even I faced it.

Basically I was working in email sending task using the ASP.Net. The main issue for me was sending mail to multiple users. Firstly, I retrieved the email address from database and used " ; " so as to separate the multiple email addresses. Because while sending the email to multiple users, in regular basis we use semicolon i.e. " ;"

Everything seemed ok but after compilation I got the error "The specified string is not in the form required for an e-mail address".

After a bit analysis, I came to know that instead of using the " ; " we should use " , " so as to separate multiple email address while sending mails . This is the formatted string for separating the emails.

For Details visit: http://kopila.com.np

Thank you! share|improve this answer

Hmm, let me see, is it possible that "txtEmail.Text" is not a valid email address? I'm just guessing here, but you might want to remove the quotes from around that to get the actual value in your control... share|improve this answer

both the sender and recipient address need to be a valid email address format. eg. user@domain.com share|improve this answer

answered Jan 21 '11 at 9:03 WraithNath 5,38111136

up vote 0 down vote

I had a problem where I was creating the message with the recipient and the sender already in it, but it returned the following error:

The specified string is not in the form required for an e-mail address

The problematic code was as follows:

MailMessage objMsg = new MailMessage(regEmail.Text.ToString(), "me@mysite.com");

I fixed the issue by replacing that code with this:

MailMessage objMsg = new MailMessage(); objMsg.From = new MailAddress(regEmail.Text.ToString()); objMsg.To.Add(new MailAddress("me@mysite.com"));

It is also helpful to use a regular expression validator in your user control to make sure the address is valid, you can use the following code for asp:

/asp:RegularExpressionValidator Or if you'd prefer to validate the email in C# then you can use this as also stated by S Fadhel Ali: public static bool IsValidEmail(String Email) { if( Email != null && Email != "" ) return Regex.IsMatch(Email, @"\w+([-+.]\w+)_@\w+([-.]\w+)_.\w+([-.]\w+)*" ); else return false; } By posting your answer, you agree to the privacy policy and terms of service. Not the answer you're looking for? Browse other questions tagged asp.net email message or ask your own question. Related 0 System.FormatException: The specified string is not in the form required for an e-mail address 1 In asp.net is there a function to validate an email address? 0 The specified string is not in the form required for an e-mail address when adding BCC to .net mail 0 The specified string is not in the form required for an e-mail address 1 Creating a new MailAddress produces “The specified string is not in the form required for an e-mail address”, although it is in the correct format 2 sending mail by System.Net.Mail 1 how to send mail by using smtp in asp.net 0 The specified string is not in the form required for an e-mail address 0 How to send mail for .org domain using web mail service in asp.net -1 ERROR: The specified string is not in the form required for an e-mail address question feed about help badges blog chat data legal privacy policy jobs advertising info mobile contact us feedback Technology Life / Arts Culture / Recreation Science Other
dineshkummarc commented 11 years ago

more answer can be found here in the url : http://stackoverflow.com/questions/4757001/the-specified-string-is-not-in-the-form-required-for-an-e-mail-address

ghost commented 11 years ago

nice work and very good debug ?

dineshkummarc commented 10 years ago

Getting error for new deployment .....

Server Error in '/' Application. Parser Error Description: An error occurred during the parsing of a resource required to service this request. Please review the following specific parse error details and modify your source file appropriately.

Parser Error Message: Could not load the assembly 'App_Web_ayjarqnd'. Make sure that it is compiled before accessing the page.

Source Error:

Line 1: <%@ page language="VB" autoeventwireup="false" inherits="TellFriend, App_Web_ayjarqnd" %> Line 2:
Line 3: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

Source File: /corporate/tellfriend.aspx Line: 1

Version Information: Microsoft .NET Framework Version:2.0.50727.5472; ASP.NET Version:2.0.50727.5456

dineshkummarc commented 10 years ago

the newly created issue is due to the failure in coping of the dll file related to the page. will make it fix.

ghost commented 10 years ago

@dineshkummarc, its working on home page but when i excess using url it fails. look deep into the matter soon.