Click here to Skip to main content
15,878,748 members
Home / Discussions / ASP.NET
   

ASP.NET

 
QuestionLogin Control Error Pin
solarthur0119-Nov-07 12:34
solarthur0119-Nov-07 12:34 
AnswerRe: Login Control Error Pin
Michael Sync19-Nov-07 14:50
Michael Sync19-Nov-07 14:50 
AnswerRe: Login Control Error Pin
Vasudevan Deepak Kumar19-Nov-07 18:04
Vasudevan Deepak Kumar19-Nov-07 18:04 
GeneralRe: Login Control Error Pin
solarthur0120-Nov-07 9:21
solarthur0120-Nov-07 9:21 
GeneralDynamic Menu in Update Panel Wanted Pin
Malcolm Smart19-Nov-07 12:18
Malcolm Smart19-Nov-07 12:18 
Questionpopup window and main window without page refresh Pin
Sarfaraj Ahmed19-Nov-07 11:04
Sarfaraj Ahmed19-Nov-07 11:04 
AnswerRe: popup window and main window without page refresh Pin
SABhatti19-Nov-07 11:21
SABhatti19-Nov-07 11:21 
QuestionThe Specified String is not in the form required by an email address Pin
Strategon19-Nov-07 10:40
Strategon19-Nov-07 10:40 
Error Happens Here:

MailMessage NewEmail = new MailMessage(); // Error happens upon instantiation of my email class



I put the email code inside of a method that passes parameters into the class as follows:


public static void SendEmail(string from, string to, string bcc, string cc, string subject, string body)
{
// Instantiate a new instance of MailMessage
MailMessage NewEmail = new MailMessage(); // ERROR: "The Specified String is not in the form required by an email address ::

// Set the sender address of the mail message
NewEmail.From = new MailAddress(from);
// Set the recepient address of the mail message
//mMailMessage.To.Add(to);
//mMailMessage.To = new MailAddressCollection().Add(new MailAddress(to));
NewEmail.To.Add(new MailAddress(to));
{
// Set the Bcc address of the mail message
NewEmail.Bcc.Add(new MailAddress(bcc));
}

// Check if the cc value is null or an empty value
if ((cc != null) && (cc != string.Empty))
{
// Set the CC address of the mail message
NewEmail.CC.Add(new MailAddress(cc));
}

// Set the subject of the mail message
NewEmail.Subject = subject;
// Set the body of the mail message
NewEmail.Body = body;

// Secify the format of the body as HTML
NewEmail.IsBodyHtml = true;
// Set the priority of the mail message to normal
NewEmail.Priority = MailPriority.Normal;

// Instantiate a new instance of SmtpClient
SmtpClient mSmtpClient = new SmtpClient();
// Send the mail message
mSmtpClient.Send(NewEmail);
}

I'm calling the method this way:

string from = EmailTextBox.Text;
string to = ContactIdentifier.EmailAddress;
string bcc = "";
string cc = "";
string subject = subjectTextBox.Text;
string body = Emailbody.ToString();

MailHelper.SendEmail(from, to, bcc, cc, subject, body);


Any Thoughts?

I will not tiptoe through life only to arrive at death safely!

Questionhow to disable the hyperlink button in repeater control.very urgent... Pin
Murugan.nett19-Nov-07 9:19
Murugan.nett19-Nov-07 9:19 
AnswerRe: how to disable the hyperlink button in repeater control.very urgent... Pin
SABhatti19-Nov-07 9:30
SABhatti19-Nov-07 9:30 
AnswerRe: how to disable the hyperlink button in repeater control.very urgent... Pin
Vasudevan Deepak Kumar19-Nov-07 18:06
Vasudevan Deepak Kumar19-Nov-07 18:06 
QuestionAssign default value in edit mode formview [modified] Pin
bnbdnb19-Nov-07 8:00
bnbdnb19-Nov-07 8:00 
AnswerRe: Assign default value in edit mode formview Pin
Christian Graus19-Nov-07 9:17
protectorChristian Graus19-Nov-07 9:17 
GeneralRe: Assign default value in edit mode formview Pin
bnbdnb19-Nov-07 9:30
bnbdnb19-Nov-07 9:30 
AnswerRe: Assign default value in edit mode formview Pin
bnbdnb19-Nov-07 9:42
bnbdnb19-Nov-07 9:42 
GeneralRe: Assign default value in edit mode formview Pin
bnbdnb19-Nov-07 17:40
bnbdnb19-Nov-07 17:40 
QuestionClient side post back Pin
solarthur0119-Nov-07 6:32
solarthur0119-Nov-07 6:32 
AnswerRe: Client side post back Pin
DigiOz Multimedia19-Nov-07 9:14
DigiOz Multimedia19-Nov-07 9:14 
AnswerRe: Client side post back Pin
pmarfleet19-Nov-07 9:15
pmarfleet19-Nov-07 9:15 
AnswerRe: Client side post back Pin
Vasudevan Deepak Kumar19-Nov-07 18:08
Vasudevan Deepak Kumar19-Nov-07 18:08 
Questionerror message in login page Pin
rocky81119-Nov-07 5:33
rocky81119-Nov-07 5:33 
AnswerRe: error message in login page Pin
Prateek G19-Nov-07 19:16
Prateek G19-Nov-07 19:16 
QuestionChange Gridview ImageButton and back Pin
GianFiume19-Nov-07 5:03
GianFiume19-Nov-07 5:03 
AnswerRe: Change Gridview ImageButton and back Pin
SABhatti19-Nov-07 9:46
SABhatti19-Nov-07 9:46 
GeneralRe: Change Gridview ImageButton and back Pin
GianFiume19-Nov-07 21:11
GianFiume19-Nov-07 21:11 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.