Sending Emails in mojoPortal

This forum is only for questions or discussions about working with the mojoPortal source code in Visual Studio, obtaining the source code from the repository, developing custom features, etc. If your question is not along these lines this is not the right forum. Please try to post your question in the appropriate forum.

Please do not post questions about design, CSS, or skinning here. Use the Help With Skins Forum for those questions.

This forum is for discussing mojoPortal development

This forum is only for questions or discussions about working with the mojoPortal source code in Visual Studio, obtaining the source code from the repository, developing custom features, etc. If your question is not along these lines this is not the right forum. Please try to post your question in the appropriate forum.

You can monitor commits to the repository from this page. We also recommend developers to subscribe to email notifications in the developer forum as occasionally important things are announced.

Before posting questions here you might want to review the developer documentation.

Do not post questions about design, CSS, or skinning here. Use the Help With Skins Forum for those questions.
This thread is closed to new posts. You must sign in to post in the forums.
1/7/2011 7:08:07 AM
Gravatar
Total Posts 46

Sending Emails in mojoPortal

Hi everyone,

when sending an email in my custom modules ive been using

<%@ Import Namespace="mojoPortal.Net" %>

        SmtpSettings smtp = new SmtpSettings();

        smtp.Password = ConfigurationManager.AppSettings["SMTPPassword"];
        smtp.Server = ConfigurationManager.AppSettings["SMTPServer"];
        smtp.User = ConfigurationManager.AppSettings["SMTPUser"];
        smtp.RequiresAuthentication = true;
        smtp.Port = Convert.ToInt16(ConfigurationManager.AppSettings["SMTPPort"]);
        smtp.PreferredEncoding = ConfigurationManager.AppSettings["SmtpPreferredEncoding"];

        string subject = "subject";
        string messageBody = "my message";

        Email.SendEmailNormal(smtp, "contactform@mysite.com", adminEmail, "", "", subject, messageBody, false, "");

is there a better way of doing this? in particular the smtp settings and such?

 

1/7/2011 7:21:31 AM
Gravatar
Total Posts 18439

Re: Sending Emails in mojoPortal

SmtpSettings smtpSettings = SiteUtils.GetSmtpSettings();

Hope it helps,

Joe

1/7/2011 7:29:21 AM
Gravatar
Total Posts 46

Re: Sending Emails in mojoPortal

oh thats so much easier! thanks joe :)

You must sign in to post in the forums. This thread is closed to new posts.