Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

I'm trying to develop event registration form using anonymous SharePoint 2010 custom list. Now, I got all the features I want; form fields, submit button that leads to confirmation page, but I want this form to send confirmation email; whenever a user register to the event he/she suppose to receive confirmation email to attend.

share|improve this question

2 Answers 2

I'm not sure if i understood you well, but you want that when a new event is added to the list, an email is sent to someone is that correct?

Basically to do that you should check the list event receivers here, this way you can add to your list the events and basically on the items add you can write some code to send emails, you can either write your own code using .Net mail objects or you have a sharepoint email system which you can also use to send emails.

I hope i could help you a bit or send you to a right direction

share|improve this answer

If your SharePoint has SMTP configured you can use following helper function to send email: You can pass SPWeb object using

SPContext.Current.Web

public static void SendEmail(SPWeb web, string mailTo, string mailSub, ref string mailMsg)
{
    var header = new StringDictionary();
    header.Add("to", mailTo);
    header.Add("subject", mailSub);
    header.Add("content-type", "text");
    SPUtility.SendEmail(web, header, mailMsg);
}

If you don't have SMTP configured in SharePoint, use code something like this or search web for "send email .NET".

share|improve this answer
    
Just a notice, if you will send e-mail in the event receiver code, you cannot use SPContext.Current objects there. You will need to use properties.Web instead –  Tim Nov 21 '13 at 14:05
    
yes @Tim you are true. Thanks for pointing out. –  AmitKB Nov 22 '13 at 2:23

Your Answer

 
discard

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 or ask your own question.