Can not send email - getting parameter address cannot be an empty string

Post here for help with installing or upgrading mojoPortal pre-compiled release packages. When posting in this forum, please provide all relevant details. You may also want to review the installation or upgrading documentation.

If you have questions about using the source code or working with mojoPortal in Visual Studio, please post in the Developer forum.

Post here for help with installation of mojoPortal pre-compiled release packages

When posting in this forum, please try to provide as many relevant details as possible. Particularly the following:

  • What operating system were you running when the bug appeared?
  • What database platform is your site using?
  • What version of mojoPortal are you running?
  • What version of .NET do you use?
  • What steps are necessary to reproduce the issue? Compare expected results vs actual results.

You may also want to review the installation or upgrading documentation.

If you have questions about using the source code or working with mojoPortal in Visual Studio, please post in the Developer forum.

This thread is closed to new posts. You must sign in to post in the forums.
7/15/2009 10:24:07 PM
Gravatar
Total Posts 34

Can not send email - getting parameter address cannot be an empty string

Windows 2008 Server Standard SP2
MS SQL Server 2008 Standard
mojoPortal 2.3.1.0

I am having trouble configuring my mojoPortal installation to send emails. I can connect to the specified email server using telnet without problem from my server. Trying various settings I always get the error "parameter 'address' cannot be an emtpy string"


This error gets logged when trying to send email through the contact form:

2009-07-16 02:52:40,678 INFO mojoPortal.Web.Global - Application Started.
2009-07-16 02:53:22,783 ERROR mojoPortal.Web.ContactUI.ContactForm - System.ArgumentException: The parameter 'address' cannot be an empty string.
Parameter name: address
at System.Net.Mail.MailAddress..ctor(String address, String displayName, Encoding displayNameEncoding)
at System.Net.Mail.MailAddress..ctor(String address)
at mojoPortal.Net.Email.SendEmailNormal(SmtpSettings smtpSettings, String from, String replyTo, String to, String cc, String bcc, String subject, String messageBody, Boolean html, String priority, String[] attachmentPaths, String[] attachmentNames)
at mojoPortal.Net.Email.SendEmailNormal(SmtpSettings smtpSettings, String from, String replyTo, String to, String cc, String bcc, String subject, String messageBody, Boolean html, String priority)
at mojoPortal.Net.Email.SendEmail(SmtpSettings smtpSettings, String from, String replyTo, String to, String cc, String bcc, String subject, String messageBody, Boolean html, String priority)
at mojoPortal.Web.ContactUI.ContactForm.btnSend_Click(Object sender, EventArgs e)

From my web.config:
-->
<add key="EnableSiteSettingsSmtpSettings" value="true" />
<add key="MaskSmtpPasswordInSiteSettings" value="false" />
<add key="ShowSmtpEncodingOption" value="false" />

<!-- ******* end multi site installation settings -->

<!-- ******* email settings
Note you also need to specify smtp settings further below in system.net section the settings here appply to features but
the settings in the system.net.mailsettigns section are used by site registration and password recovery -->

<add key="DisableDotNetOpenMail" value="true" />
<add key="SMTPServer" value="postur.simnet.is" />
<add key="SMTPRequiresAuthentication" value="true" />
<add key="SMTPUseSsl" value="false" />
<add key="SMTPPort" value="25" />
<add key="SMTPUser" value="xxx@simnet.is" />
<add key="SMTPPassword" value="*******" />
<add key="SMTPTimeoutInMilliseconds" value="30000" />
<!-- leave this blank for ascii encoding -->
<add key="SmtpPreferredEncoding" value="" />
<!-- example for Russian encoding
<add key="SmtpPreferredEncoding" value="koi8-r" />
-->

and:

<system.net>
<mailSettings>
<smtp from="xxxx@dexxen.com">
<network host="postur.simnet.is" port="25" password="********" userName="xxx@simnet.is" />
</smtp>
</mailSettings>
</system.net>


From the Mail settings in Administration UI:

SMTP User: xxx@simnet.is
SMTP Password : *******
SMTP Server : postur.simnet.is
SMTP Port : 25
SMTP Requires Authentication? true
SMTP Use SSL? False

 

7/16/2009 6:40:52 AM
Gravatar
Total Posts 18439

Re: Can not send email - getting parameter address cannot be an empty string

Hi,

You need to configure an address in the contact form where it should send the email. Click the gears next to the title to get to Feature Instance Settings. This allows different contact forms to go to different addresses.

Hope it helps,

Joe 

7/16/2009 2:13:07 PM
Gravatar
Total Posts 34

Re: Can not send email - getting parameter address cannot be an empty string

Stupid me!, I never clicked on the gears icon because I did not realise that there were any settings there besides those in the config file. I somehow assumed that the emails would all be sent to the SMTPUser.

Thanks for a helpful and quick response.

regards

Finnur (enjoying mojoPortal and looking forward to use it on many  more projects)

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