|
|
|
stevechubboy.com Joined: 1/20/2006
Posts: 42
|
|
|
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!
|
|
|
|
| |
|
|
Joined: 3/2/2004
Posts: 16
|
|
|
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.
|
|
|
|
| |
|
|
Joined: 1/20/2006
Posts: 18
|
|
|
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.
|
|
|
|
| |
|
|
stevechubboy.com Joined: 1/20/2006
Posts: 42
|
|
|
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
|
|
|
|
| |
|
|
Joined: 12/6/2003
Posts: 15
|
|
|
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
|
|
|
|
| |