Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeDNN Open Source...DNN Open Source...Module ForumsModule ForumsEventsEventsNotificationsNotifications
Previous
 
Next
New Post
10/11/2006 6:20 PM
 
I am having this same problem about the event notification email not being sent - and trying to send an email from the "Edit event --> Enrollment --> Email All Enrolled Users" does not work.

I have enabled the Scheduler for the Events Module from the "Host --> Schedule --> DotNetNuke....Events --> Settings --> Schedule Enabled" area, and I'm getting 2 errors from the Log Viewer:


----------------------------------------------------------------------------------

1.)
"Scheduler Event Failure" with detail:
TYPE: DotNetNuke.Modules.Events.EventNotification
EXCEPTION: The parameter 'to' cannot be an empty string. Parameter name: to

2.)
"Scheduler Exception" with detail:
InnerException: The parameter 'to' cannot be an empty string. Parameter name: to
FileName:
FileLineNumber: -1
FileColumnNumber: -1
Method:
StackTrace:
Message: System.ArgumentException: The parameter 'to' cannot be an empty string. Parameter name: to at System.Net.Mail.MailMessage..ctor(String from, String to) at DotNetNuke.Services.Mail.Mail.SendMail(String MailFrom, String MailTo, String Cc, String Bcc, MailPriority Priority, String Subject, MailFormat BodyFormat, Encoding BodyEncoding, String Body, String Attachment, String SMTPServer, String SMTPAuthentication, String SMTPUsername, String SMTPPassword) at DotNetNuke.Modules.Events.EventNotification.SendEventNotifications() at DotNetNuke.Modules.Events.EventNotification.DoWork()
3.)
I am also getting this error from the Scheduler History on the Events Schedule:

Event Notification failed.System.ArgumentException: The parameter 'to' cannot be an empty string.
Parameter name: to
at System.Net.Mail.MailMessage..ctor(String from, String to)
at DotNetNuke.Services.Mail.Mail.SendMail(String MailFrom, String MailTo, String Cc, String Bcc, MailPriority Priority, String Subject, MailFormat BodyFormat, Encoding BodyEncoding, String Body, String Attachment, String SMTPServer, String SMTPAuthentication, String SMTPUsername, String SMTPPassword)
at DotNetNuke.Modules.Events.EventNotification.SendEventNotifications()
at DotNetNuke.Modules.Events.EventNotification.DoWork()


----------------------------------------------------------------------------------


Can anyone give me some clues, or tips on things to try? Also, I am able to send mail from the system, e.g., using the newsletter function of my portal - so I'm sure that SMTP is working for the portal.

Thanks in advance for any help!
 
New Post
10/12/2006 8:05 PM
 

I have DNN 4.3.5 and get this error when sending any Event notifications: 

UserAgent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322; .NET CLR 2.0.50727)
DefaultDataProvider: DotNetNuke.Data.SqlDataProvider, DotNetNuke.SqlDataProvider
ExceptionGUID: bc64361b-5370-4dcf-a0b3-5640b6a26d42
InnerException: The SMTP host was not specified.
FileName:
FileLineNumber: 0
FileColumnNumber: 0
Method: System.Net.Mail.SmtpClient.CheckHostAndPort
StackTrace:
Message: System.InvalidOperationException: The SMTP host was not specified. at System.Net.Mail.SmtpClient.CheckHostAndPort() at System.Net.Mail.SmtpClient.Send(MailMessage message) at DotNetNuke.Services.Mail.Mail.SendMail(String MailFrom, String MailTo, String Cc, String Bcc, MailPriority Priority, String Subject, MailFormat BodyFormat, Encoding BodyEncoding, String Body, String Attachment, String SMTPServer, String SMTPAuthentication, String SMTPUsername, String SMTPPassword)
Source:

 

I have no problem testing SMTP settings or using the newsletters/bulk emal.

 
New Post
10/27/2006 1:27 PM
 
I'm having the same problems as everyone else in this thread.  Detailed info:

DNN 4.3.5
Events Module 3.02.00
Sending Newsletters works without a hitch.
Scheduler is enabled under Host -> Schedule -> DotNetNuke.Modules.Events.EventNotification, DotNetNuke.Modules.Events

Notifications do not get sent out.  The following error occurs in the Log Viewer:
Scheduler Exception
AssemblyVersion: -1
PortalID: -1
PortalName:
UserID: -1
UserName:
ActiveTabID: -1
ActiveTabName:
RawURL:
AbsoluteURL:
AbsoluteURLReferrer:
UserAgent:
DefaultDataProvider:
ExceptionGUID:
InnerException: The parameter 'to' cannot be an empty string. Parameter name: to
FileName:
FileLineNumber: -1
FileColumnNumber: -1
Method:
StackTrace:
Message: System.ArgumentException: The parameter 'to' cannot be an empty string. Parameter name: to at System.Net.Mail.MailMessage..ctor(String from, String to) at DotNetNuke.Services.Mail.Mail.SendMail(String MailFrom, String MailTo, String Cc, String Bcc, MailPriority Priority, String Subject, MailFormat BodyFormat, Encoding BodyEncoding, String Body, String Attachment, String SMTPServer, String SMTPAuthentication, String SMTPUsername, String SMTPPassword) at DotNetNuke.Modules.Events.EventNotification.SendEventNotifications() at DotNetNuke.Modules.Events.EventNotification.DoWork()
Source:
Server Name: <removed>

Followed by:
Scheduler Event Failure
THREAD ID: 10
TYPE: DotNetNuke.Modules.Events.EventNotification
EXCEPTION: The parameter 'to' cannot be an empty string. Parameter name: to
RESCHEDULED FOR: 10/27/2006 1:41:03 PM
SOURCE: STARTED_FROM_BEGIN_REQUEST
ACTIVE THREADS: 1
FREE THREADS: 0
READER TIMEOUTS: 0
WRITER TIMEOUTS: 0
IN PROGRESS: 2
IN QUEUE: 3
Server Name: <removed>

Followed by:
General Exception
AssemblyVersion: -1
PortalID: -1
PortalName:
UserID: -1
UserName:
ActiveTabID: -1
ActiveTabName:
RawURL:
AbsoluteURL:
AbsoluteURLReferrer:
UserAgent:
DefaultDataProvider:
ExceptionGUID:
InnerException: The parameter 'to' cannot be an empty string. Parameter name: to
FileName:
FileLineNumber: -1
FileColumnNumber: -1
Method:
StackTrace:
Message: System.ArgumentException: The parameter 'to' cannot be an empty string. Parameter name: to at System.Net.Mail.MailMessage..ctor(String from, String to) at DotNetNuke.Services.Mail.Mail.SendMail(String MailFrom, String MailTo, String Cc, String Bcc, MailPriority Priority, String Subject, MailFormat BodyFormat, Encoding BodyEncoding, String Body, String Attachment, String SMTPServer, String SMTPAuthentication, String SMTPUsername, String SMTPPassword) at DotNetNuke.Modules.Events.EventNotification.SendEventNotifications() at DotNetNuke.Modules.Events.EventNotification.DoWork()
Source:
Server Name: <removed>



The above messages would indicate that there is nothing in the "to" field, however both test users that enrolled in the event had valid addresses assigned in their profiles.


Sending messages to Enrolled members through the Events module also generates errors:
InnerException: The SMTP host was not specified.

And when I checked the checkbox to attach the event, the following error was generated:
InnerException: The process cannot access the file 'C:\Inetpub\wwwroot\dotnetnuke\Portals\15521ee264-4781-4942-abf6-a1b7a199e570.vcs' because it is being used by another process.


The functionality available in this module is phenomenal.  Extremely useful for the types of things I want to do, however these notification/email issues are standing in the way.  Any assistance would be greatly appreciated.

 
New Post
10/31/2006 2:51 PM
 
Ok everyone, I have done a lot of work to this module, and I have the Enrollments working. There is a bug in the Events code, so I did a couple things:

1.) I converted the project to work within the App_Code folder, this required modifying the CreateProvider() method in the DataProvider code to use the new .NET 2 way of querying for the Assembly, instead of referring to the DLL as it did when it was pre-compiled. You also have to modify your web.config to use the codeSubDirectories, dividing up the events module into three folders. If anyone wants to get a .zip file of files, post here or send me an email. It is important to get the correct files within the correct directories together.

2.) Separate from the App_Code thing (this file will work if you re-compile the original project, OR if you do the above App_Code thing), the method Mail() in EditEvents.ascx.vb calls the wrong method in the DotNetNuke.Services.Mail class. I simply modified the method to correctly query the DNN framework for the SMTP settings. Everything now works as advertised. Code is posted below all this

Note: I just fixed this - I've not checked to see if Notifications work yet, but I'll post back when I get it checked.

Oh, and those of you with a problem with the "to" string, I had that, then I traced the code and realized I hadn't set the email address for the SuperUser account, I'm guessing you logged in as Host or Admin, and then didn't set your email address in the SuperUsers Accounts section. That'll give you that error.




OK here is the code are you need to modify in EditEvents.ascx.vb (I included the whole method, so just copy and paste):
 
    Private Sub Email(ByVal Selected As Boolean)
            Dim item As DataGridItem
            Dim subject As String
            Dim body As String
            Dim attachment As StringBuilder
            Dim oVEvent As New vEvent
            Dim objCtlUser As New UserController
            Dim objModUser As New UserInfo
            Dim objEventUser As New UserInfo
            Dim fp As System.IO.StreamWriter
            Dim filepath As String = ""
            objModUser = objCtlUser.GetUser(PortalId, UserId)
            Dim useremail As String = objModUser.Membership.Email
            Dim objEnroll As EventSignupsInfo
            Dim objportal As DotNetNuke.Entities.Portals.PortalInfo = New DotNetNuke.Entities.Portals.PortalController().GetPortal(PortalId)
            Dim SMTPServer As String = Nothing
            Dim SMTPAuthentication As String = Nothing
            Dim SMTPUsername As String = Nothing
            Dim SMTPPassword As String = Nothing

            ' SMTP server configuration

            If Convert.ToString(Common.Globals.HostSettings("SMTPServer")) <> "" Then
                SMTPServer = Convert.ToString(Common.Globals.HostSettings("SMTPServer"))
            End If
            If Convert.ToString(Common.Globals.HostSettings("SMTPAuthentication")) <> "" Then
                SMTPAuthentication = Convert.ToString(Common.Globals.HostSettings("SMTPAuthentication"))
            End If
            If Convert.ToString(Common.Globals.HostSettings("SMTPUsername")) <> "" Then
                SMTPUsername = Convert.ToString(Common.Globals.HostSettings("SMTPUsername"))
            End If
            If Convert.ToString(Common.Globals.HostSettings("SMTPPassword")) <> "" Then
                SMTPPassword = Convert.ToString(Common.Globals.HostSettings("SMTPPassword"))
            End If


            For Each item In Me.grdEnrollment.Items
                If CType(item.FindControl("chkSelect"), CheckBox).Checked Or (Selected = False) Then
                    objEnroll = Me.objCtlEventSignups.EventsSignupsGet(CType(grdEnrollment.DataKeys(item.ItemIndex), Integer))

                    ' Email Requesting User
                    subject = txtEmailSubject.Text
                    body = "<p><a href="
                    body += NavigateURL(TabId, "Details", "mid=" & ModuleId, "ItemID=" & objEnroll.EventID.ToString(), "selecteddate=" & objEnroll.EventDateBegin.ToShortDateString) & ">"
                    body += String.Format(Localization.GetString("EnrollMessage", LocalResourceFile), objEnroll.EventName, objEnroll.EventDateBegin.ToShortDateString, objEnroll.EventTimeBegin.TimeOfDay.ToString)
                    body += "</a></p>"

                    If Me.chkAttachment.Checked Then
                        body += Localization.GetString("Attachment", LocalResourceFile)
                        attachment = oVEvent.GetOutlookEvent(objEnroll.EventID, Context, objEnroll.EventDateBegin)
                        ' Create Attachment File
                        filepath = Request.MapPath(objportal.HomeDirectory) + Guid.NewGuid.ToString + ".vcs"
                        fp = System.IO.File.CreateText(filepath)
                        fp.Write(attachment)
                        fp.Close()
                        body += txtEmailMessage.Text
                        body = System.Web.HttpUtility.HtmlDecode(body).Replace(vbCrLf, "").Trim
                        DotNetNuke.Services.Mail.Mail.SendMail(useremail, objEnroll.Email, "", "", MailPriority.Normal, subject, MailFormat.Html, System.Text.Encoding.UTF8, body, filepath, SMTPServer, SMTPAuthentication, SMTPUsername, SMTPPassword)
                        If System.IO.File.Exists(filepath) Then
                            System.IO.File.Delete(filepath)
                        End If
                    Else
                        body += txtEmailMessage.Text
                        body = System.Web.HttpUtility.HtmlDecode(body).Replace(vbCrLf, "").Trim
                        DotNetNuke.Services.Mail.Mail.SendMail(useremail, objEnroll.Email, "", "", MailPriority.Normal, subject, MailFormat.Html, System.Text.Encoding.UTF8, body, "", SMTPServer, SMTPAuthentication, SMTPUsername, SMTPPassword)
                    End If
                End If
            Next
        End Sub


 
New Post
10/31/2006 6:02 PM
 

I tried it and it seems to work great. Great work! I really appreciate this effort sice I had someone who needed this now.

Thanks

 
Previous
 
Next
HomeHomeDNN Open Source...DNN Open Source...Module ForumsModule ForumsEventsEventsNotificationsNotifications


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out