.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

How to automatically run code and send emails?

Posted By:      Posted Date: September 07, 2010    Points: 0   Category :ASP.Net
Hi all- I would like to have users set some parameters, then have routines run in the middle of the night and if the user parameters are met, have an automated email sent to update the user at various time intervals as set by user , ie daily, weekly, monthly, etc.) Can someone please point me in the right direction on how I go about doing this?    

View Complete Post

More Related Resource Links

Automatically Execute Code at certain time from website


Is there a way to trigger a piece of code to execute at a certain time once a week?

I basically want my website to send out a reminder email every sunday. I have a function called SendReminder() and I would like to know if it is posible for it to run by itself because at the minute I have to press a button to run it.


.net 3.5 in conjunction with CRM 4.0 email router adding code to subject line of emails causing spam

We use CRM 4.0, which is using .net framework 3.5 SP 1.  Emails sent out of CRM go through and email router and the subject line of these emails is getting "=?us-ascii?Q? added to the beginning of the subject line and "?= added to the end of the subject line. This is causing a large amount of our emails getting spammed. I was told by the CRM support that this is an issue with .net 3.5 and won't be fixed until .net 4.0, which CRM won't support for another year.  Is there not a .net 3.5 patch that can address this?

AUTOMATICALLY send an email on a future date

HiI would like to achieve the following. 1- if a user goes to a web page in a web application hosted on the Internet and selects a FUTURE date from a "Calendar control" the date selected and the URL for the page are stored in the database (I know how to do this step) 2- when the date selected arrives the URL will be embedded in an email that is sent out AUTOMATICALLY to the user. How can I trigger the email to go out AUTOMATICALLY on the selected date?????? Does the link below help me answer this question??  I just need a high level steps on how to do this. Your help is greatly appreciated. http://msdn.microsoft.com/en-us/magazine/cc163821.aspx

how to send email in asp.net with attachment c# code

 SmtpClient smtpClient = new SmtpClient();         MailMessage message = new MailMessage();         try         {             MailAddress fromAddress = new MailAddress(txtEmail.Text, txtName.Text);             // You can specify the host name or ipaddress of your server             // Default in IIS will be localhost              smtpClient.Host = "localhost";             //Default port will be 25             smtpClient.Port = 25;             //From address will be given as a MailAddress Object             message.From = fromAddress;             // To address collection of MailAddress             message.To.Add("admin1@yoursite.com");             message.Subject = "Feedback";             // CC and BCC optional             // MailAddressCollection class is used to send the email to various users   

how to send email in asp.net to any destination eg yahoo,gmail,hotmail etc c# code

hi i have try many code for sending email from msdn and many sites.but still i could do so. some code are here...   SmtpClient smtpClient = new SmtpClient();         MailMessage message = new MailMessage();           try         {             MailAddress fromAddress = new MailAddress(txtEmail.Text, txtName.Text);               // You can specify the host name or ipaddress of your server             // Default in IIS will be localhost              smtpClient.Host = "localhost";               //Default port will be 25             smtpClient.Port = 25;               //From address will be given as a MailAddress Object             message.From = fromAddress;               // To address collection of MailAddress             message.To.Add("admin1@yoursite.com");             message.Subject = "Feedback";               // CC

Best Way to Send Multiple Emails

I'm building a website that allows users to post comments. When they do, they can check a box that indicates if they want an email notification when someone else posts a comment under the same topic. (Similar to this web site.)This means when a comment is posted, the code has to send an email to all the subscribed users.My concern is about what happens when many users are subscribed to a topic. There is a short delay when sending an email. Sending dozens or potentially even hundreds could really cause a delay.Right now, I just loop through each user and send the emails one by one. Does anyone know if that's the best way?Thanks!

Automatically inserting server-side page events into C# when using code separation

I know this is a really basic question and I have spent the last half hour trying to find an answer so please forgive me if this has been asked before (it probably has)....When I create a web page with the C# code placed in a separate file I can't seem to easily add page events (apart from Page_Load). When I open the C# class code for the page all I see in the two drop-down boxes above the code is "Default" (with no other options in the drop-down) in the left-hand box and "ApplicationInstance,form1,Page_Load(object sender,EventArgs e),Profile" in the right hand box. I can't see a way to create the code for the other page events from either of these drop-downs.If I keep the C# code in the same file (i.e., not use code separation) everything works fine - I see "Server Objects & Events, Page, Form1, etc..." in the left hand drop-down and I can create new events in the right drop-down when either Page or Form1 are selected in the left box.Am I missing something really obvious?Many thanks for any suggestions

Send report to printer from code-behind...



I would like to create a print button to send a .rdlc report to the users printer. Since i'm not using report viewer to view my reports using it's controls is not an alternative.

I have a button that generates a .pdf file from the report, and now i would like to make a similar button, but to print the report.

Can anyone help me?

Send 2 emails (different) on CreateUserWizard1_CreatedUser


I have a web application that allows a user to "join" our site.  When the CreateUserWizard completes, I just have the code below in the bottom of my wizard tags; and this works!

<MailDefinition BodyFileName="~/EmailTemplates/NewRegistrationUser.txt" Subject="Arts & Crafts Website - New Registration" >

I need to now add a second email that'll tell site admins that this particular user has requested access.  So the user gets an email saying "Thanks for registering... account is pending authorization"!  At the same time I need a second email to be sent to the site admins (just one email address) stating something like "A new user <%username%> has requested to join your site".  This is what I tried, but doesn't work:

<MailDefinition BodyFileName="~/EmailTemplates/NewRegistrationUser.txt" Subject="Arts & Crafts Website - New Registration" >
<MailDefinition BodyFileName="~/EmailTemplates/NewRegistrationSiteAdminAlert.txt" Subject="Arts & Crafts Website - New Registration" >

Of course this isn't working because the CreateUserWizard automatical

How do I assign the return value of a async code activity to the send activity in a workflow?



Here's my scenario:

- I have a WF service with a Pick activity. 

- The pick branch contains a Sequence activity in the trigger section. 

- The sequence contains a Receive activity that receives some information from another WF service.  It then performs an async code activity called CopyFiles.  CopyFiles returns a boolean value based on if the copy was successful or not. 

- The Action section of the pick branch has a Send activity, which will send this result to the calling WF service.

- The calling WF will look at this boolean value and decide whether to move to the next step or not.


How can I pass this boolean value to the Send activity?

Below is my async CopyFiles activity:

public sealed class CopyFiles : AsyncCodeActivity<bool>
    public InArgument<Services.Application> Application { get; set; }
    public InArgument<Services.Resource> ResourceFrom { get; <

Sharepoint 2010, Not able to send emails?




I have installed Sharepoint 2010 on Windows server 2008 with SQL 2008. The installation was successful and I am able to access Sharepoint but when I add users and try sending invitation email I get error message. I have setup all the email configuration setting on Sharepoint, i.e. provided the SMTP server name and outgoing and incoming email address but still getting the same error message. I thought there might be some SMTP issue, so installed Outlook and configured it and I am able to receive emails on outlook using the same SMTP server. Could someone help me on this?

Can't send SMTP to all emails


Hi, I can send email with my asp.net 2.0 to gmail and other domains with my local SMTP server, but if I try and send it to a cellphone like 5551234567@tmomail.net, the mail just gets stuck in the SMTP queue.  I can send a text message via email to that same email address with normal email.  For example, I can send an email through gmail or my company's server to the tmomail.net email, but I can't from my local SMTP server.  I can send email with my local SMTP server to other Internet and Intranet emails, just not the phone.  My local SMTP is working, security is for localhost only, just can't send to this address.

 Thanks for any help.

Need code for send email from enquiry form


Dear All

I need code in C# and ASP.Net for send Email from enquiry form



how to send emails to multiple persons at the same time from sharepoint workflow using visual studio


Hi Every one !!

   I am trying to send copy of a document for multiple directors at my client for their approval.

   The director can approve the document at the same time.

   Hence, I would like to know how to create a task to send emails for multiple people at the same time from a sharepoint workflow using visual studio 2008.

   I see there is a parallel activity. But it gives me only 2 paths ( means would be able to send only for 2 users )

   If creating a separate task to send emails for each user is an inefficient way, please let me know if there is another good way of sending emails to multiple users.


Thank you

SPD workflow doesn't send email to user in list when automatically started

Hi all,

My first post here and I hope someone out there could kindly help. I recently found out a strange issue with my SPD workflow. Basically, it couldn't send out email if (1) the recipient resides in the list and (2) the workflow is automatically started.

For example, I have a list with a "user" field. A workflow first "Send an email" to this user, and then "Collect data from a user" from this user. If the workflow is set to start automatically, then this user gets no email. Tasks list does contain a task, but the "Assigned To" field of the task is empty. This is the case no matter if the user field is of type "Single line of text" or "Person or Group".

Everything's fine if I manually start the workflow. And everything's fine if the user is directly spelled out (jay@company.com) in the "Send an email" and "Collect data from a user" actions instead of retrieved from the list. Either case the user would get two emails as expected, and the "Assigned To" field would display the user name properly.

I looked into the log but didn't find anything special. As you can imagine, this is breaking a lot of our workflows and making SPD workflow look very bad. It's just not

Should Lotus Notes Client be running or Open in background to send emails programatically using .NET



Does Lotus notes client be running or opened in the background to send emails using Lotus Notes with .Net?

    I am working on a task where my app should send emails using Lotus Notes with .NET . I am able to send mails also. But the problem comes when i close my Lotus Notes mail and try to run my application which sends mails. But the mails are not being delivered. Reason, they were being stored in "Outgoing mail". Again when i open my Lotus Notes client by entering my username and password, then the mails that were in "Outgoing mail" were been delivered. Should lotus notes client run on the background for my application to send emails? Is there any way that my application sends emails even if lotus notes is not opened? I'm struck with this issue all day, did lot of research, but i could find anything.

i used this link  as a base ref to send emails using .net http://www.ibm.com/developerworks/lotus/library/domino-msnet/  

Any help regarding this is greatly appreciated.

Mail send successfully with error in code



I am having problem in sending mail from a click of a button. When I send mail, it sent successfully but it not including the body in mail. The mail only contain the subject. While checking the code I found that compiler is ignoring the error in code. Check the image below. Compiler is ignoring the required semicolon. Plz let me know how can I solve this problem. Thanks in adv.

ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend