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.
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.
Hi:
I am trying to send an e-mail from my application. I transferred these settings:
<add key="SMTPServer" value="myexchg"/> <add key="SMTPRequiresAuthentication" value="false"/> <add key="SMTPUseSsl" value="false"/> <add key="SMTPPort" value="25"/> <add key="SMTPUser" value="user@myDomainName.net"/> <add key="SMTPPassword" value="mypassword"/> <add key="SMTPTimeoutInMilliseconds" value="30000"/>
to my User.config file.
I am receiving an error of "host not specified".
What does the code you use to send the email look like?
MailMessage message = new MailMessage(); message.From = new MailAddress("sender@mydomain.net");
message.To.Add(new MailAddress("myname@mydomain.net"));
message.IsBodyHtml = true;
message.Subject = "<b>This is the subject</b>"; message.Body = "<b>This is the content</b>";
SmtpClient client = new SmtpClient(); client.Host = "myhost";
try { client.Send(message); } catch (SmtpException smtpEx) {
string s = smtpEx.Message;
} catch (Exception ex) { string s = ex.Message;
}
It works but I need to set the "host" in code.
Hi,
The problem is that there is nothing to automagically assign those config settings to the SmtpClient object. I've just created an article Sending Email From Custom Code, to illustrate our helper methods that you can use to send email.
Hope that helps,
Joe