Click here to Skip to main content
15,072,209 members

SShoiab - Professional Profile



Summary

    Blog RSS
5
Authority
5
Debator
11
Organiser
195
Participant
0
Author
0
Editor
0
Enquirer
No Biography provided

Reputation

Weekly Data. Recent events may not appear immediately. For information on Reputation please see the FAQ.

Privileges

Members need to achieve at least one of the given member levels in the given reputation categories in order to perform a given action. For example, to store personal files in your account area you will need to achieve Platinum level in either the Author or Authority category. The "If Owner" column means that owners of an item automatically have the privilege. The member types column lists member types who gain the privilege regardless of their reputation level.

ActionAuthorAuthorityDebatorEditorEnquirerOrganiserParticipantIf OwnerMember Types
Have no restrictions on voting frequencysilversilversilversilver
Bypass spam checks when posting contentsilversilversilversilversilversilvergoldSubEditor, Mentor, Protector, Editor
Store personal files in your account areaplatinumplatinumSubEditor, Editor
Have live hyperlinks in your profilebronzebronzebronzebronzebronzebronzesilverSubEditor, Protector, Editor
Have the ability to include a biography in your profilebronzebronzebronzebronzebronzebronzesilverSubEditor, Protector, Editor
Edit a Question in Q&AsilversilversilversilverYesSubEditor, Protector, Editor
Edit an Answer in Q&AsilversilversilversilverYesSubEditor, Protector, Editor
Delete a Question in Q&AYesSubEditor, Protector, Editor
Delete an Answer in Q&AYesSubEditor, Protector, Editor
Report an ArticlesilversilversilversilverSubEditor, Mentor, Protector, Editor
Approve/Disapprove a pending ArticlegoldgoldgoldgoldSubEditor, Mentor, Protector, Editor
Edit other members' articlesSubEditor, Protector, Editor
Create an article without requiring moderationplatinumSubEditor, Mentor, Protector, Editor
Approve/Disapprove a pending QuestionProtector
Approve/Disapprove a pending AnswerProtector
Report a forum messagesilversilverbronzeProtector, Editor
Approve/Disapprove a pending Forum MessageProtector
Create a new tagsilversilversilversilver
Modify a tagsilversilversilversilver

Actions with a green tick can be performed by this member.


 
GeneralSending email in .net Pin
SShoiab23-May-07 6:06
MemberSShoiab23-May-07 6:06 
Hi everybody....I need help. I am writing code to read the controls on the form and send email where first 2 controls goes in TO and From and rest controls goes in the body of the email.

The following function at is working and dispalying the labels and text of the control on the form.So the code is reading and displaying controls on the form…All I need is to send that info in email now.
The only problem I am facing how to send that information in email like first control goes in TO, 2nd as FROM and the rest in the body….by calling the send email function…….thanks for ur help….plz reply me at ur earliest convenience.



Here is the code: How can I call the sendemail function in DisplyDetails to send the controls text info in email



private void DisplyDetails(Control control)

{



foreach (Control controls in this.form1.Controls)

{



string controlId = controls.ID;



Response.Write(controlId);



Response.Write("
");



Type controlType = controls.GetType();



PropertyInfo[] properties = controlType.GetProperties();



foreach (PropertyInfo controlProperty in properties)

{



if (controlProperty.Name == "Text" &&



controlProperty.PropertyType == typeof(String))



{



string propertyValue = GetPropertyValue(controlProperty.Name, controls);



Response.Write(propertyValue);



Response.Write("

");

SendmMail(this);





}



}



}



}







private string GetPropertyValue(string pName, Control control)

{

Type type = control.GetType();



string propertyName = pName;



BindingFlags flags = BindingFlags.GetProperty;



Binder binder = null;



object[] args = null;



object value = type.InvokeMember(propertyName, flags, binder, control, args);



return value.ToString();



}

private void SendmMail()

{

MailMessage mail = new MailMessage();

mail.From =; // put the from address here

mail.To =; // put to address here

mail.Body =



// put body of email here

SmtpMail.SmtpServer = "mail.creighton.edu"; // put smtp server you will use here

// and then send the mail

SmtpMail.Send(mail);

FromMail.Text = "";

ToMail.Text = "";

txtMessage.Text = "";

txtSubject.Text = "";

Response.Write("your email has been sent successfully");



}

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.