So I have access to a SP 2010 website but am developing another stand alone, non SP website on the same domain.

I haven't been given a mailer or an sql box so I've been using custom lists, an api and csom to load data from SP for this new site. I would love to also be able to use this SP box in the same way to send email.

I have tried several different ways but they all fail, making me wonder if I can even do this at all.

Anyone have any idea whether this is possible?


I think you could use System.Net.Mail.SmtpClient to send email. Sample code:

MailMessage mail = new MailMessage();
            SmtpClient SmtpServer = new SmtpClient("smtp.gmail.com");

            mail.From = new MailAddress("me@mydomain.com");
            mail.Subject = filename;
            mail.Body = "Report";
            Attachment attachment = new Attachment(filename);

            SmtpServer.Port = 25;
            SmtpServer.Credentials = new System.Net.NetworkCredential("me", "password");
            SmtpServer.EnableSsl = true;


Some links for your reference:



Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.