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.
Hello,
I've seen lots of different topics regarding this but haven't found anything that answers my issue.
I've created a custom page within mojoPortal which will be a contact form. I am aware that there is a ContactForm module built into mojoPortal, but I'd like to use my own.
However, when I created my custom contact page, I also created a code-behind page in a separate file (just a habit) - this is where my contact form logic is placed - below is the logic that I am using for the submit enquiry button:
{
//create the mail message MailMessage mail = new MailMessage(); mail.From = new MailAddress("enquiries@website.com"); mail.Subject = "This is an enquiry from the website : " + Subject.Text;
mail.To.Add("rick@website.com"); mail.IsBodyHtml = true;
System.Text.StringBuilder emailBodyString = new System.Text.StringBuilder();
emailBodyString.Append("<b>Name : </b>" + Name.Text); emailBodyString.Append("<br><b>E-mail : </b>" + Email.Text); emailBodyString.Append("<br><b>Telephone number : </b>" + Telephone.Text); emailBodyString.Append("<br><b>Subject : </b>" + Subject.Text); emailBodyString.Append("<br><b>Message : </b>" + message.Text);
mail.Body = emailBodyString.ToString();
//send the message SmtpClient smtp = new SmtpClient("localhost"); try { smtp.Send(mail); } catch { successLabel.Text = "There has been an error sending your email"; } Whenever the enquiry is submitted (and I remove the try / catch block) I get an error "5.7.1 Unable to relay for ..."
This is strange as it works for other websites that I have built (not mojoPortal websites) as the code is the same. Am I missing something glaringly obvious?
Many thanks
Rick
sounds like your smtp server running at localhost is not configured correctly, I recommend do some googling on this error, there is lots of information available.