Small width layout Medium width layout Maximum width layout Small text Medium text Large text
     Search
Downloads Downloads Directory Directory Forums Forums Forge Forge Blogs Blogs        Marketplace Marketplace Careers Program Careers
Community › Forums Register  |  

Maximum ASP
  Ads  
Active Modules -- Active Forums for DotNetNuke
 


  Sponsors  

Meet Our Sponsors

Mad Development is a full service interactive agency focusing on the merge of design, technology, e-commerce, and affiliate marketing by providing total website solutions.
SteadyRain
DataSprings - Great Ideas. Always Flowing.
R2integrated - formerly bi4ce
Jango Studios - Skins, Modules and Hosting for DotNetNuke
eUKhost.com is commited to offer exceptional UK Windows Web Hosting solutions with quality 24x7 technical support.Our plans support ASP.Net, ASP, ASP.NET Ajax extensions, XML, MSSQL, MySQL, PHP,DNN, multiple domains and Shared SSL as standard.
 


DotNetNuke Forums
 
  Forum  General DotNetN...  Extend It! ( Pr...  Send Email From Custom Module
Previous Previous
 
Next Next
New Post 2/11/2006 3:39 AM
User is offline Bilal Haidar
136 posts
9th Ranked




Send Email From Custom Module 

Hi:

I am developing a contact us form as a custom module in DNN. I would like to know, how can I send the form's entries by email?

I will be using Mail.SendMail(); method, however, there are some fields like the SMTP server that confuses me.

I have set the host SMTP and the host Email, do I just use this method? what smtp I should give it? Is it the same as the one configured in the application? If yes, is there a way to get the SMTP programmatically, like PortalSettings.Email, you get email, I couldn't find PortalSettings.SMTP.

Thanks,

 
New Post 2/11/2006 3:18 PM
User is offline Steve Fabian
1510 posts
5th Ranked








Re: Send Email From Custom Module 

Hi bhaidar,

You should use the DotNetNuke core SendNotification() function. There's no reason for you to be writing your own email code since a core function exists to do so already.

Public Function SendNotification(ByVal MailFrom As String, ByVal MailTo As String, ByVal Bcc As String, ByVal Subject As String, ByVal Body As String) As String

The function resides in the Components\Shared\Globals.vb source file


Steve Fabian
Gooddogs.com
Sit, Stay, Code ... Good boy!
 
New Post 2/11/2006 3:21 PM
User is offline Bilal Haidar
136 posts
9th Ranked




Re: Send Email From Custom Module 

Hello Steve:

Thanks a lot. I was intending to use SendEmail. but it seems this is much better, direct to the point.

I am developing my first custom module using C#/VS.NET 2003/CodeSmith templates, I am loving it a lot.

Regards

Note: When will a user be unmoderated here on the DNN forums? I am an MVP in ASP/ASP.NET, moderator at the ASP.NET forums, and the top poster too.

 

 
New Post 2/14/2006 7:05 AM
User is offline Mark Orsted
7 posts
10th Ranked


Re: Send Email From Custom Module 

Why, when I open up the DotNetNuke.Modules solution, do I see the following:

 

C:\Inetpub\wwwroot\dotnetnuke\DesktopModules\Feedback\Feedback.ascx.vb(191): 'Public Function SendNotification(MailFrom As String, MailTo As String, Bcc As String, Subject As String, Body As String) As String' is obsolete: 'This function has been replaced by DotNetNuke.Services.Mail.Mail.SendMail'

I also see the following (on an aside)

C:\Inetpub\wwwroot\dotnetnuke\DesktopModules\Events\EventsController.vb(150): 'Public Function XMLEncode(HTML As String) As String' is obsolete: 'This function has been replaced by DotNetNuke.Common.Utilities.XmlUtils.XMLEncode'

Anyone able to tell me why this is in the source of the latest "final" release of DNN???

 

 

Marko

 

 
New Post 2/17/2006 9:25 AM
User is offline Marion Dickten
2 posts
10th Ranked


Re: Send Email From Custom Module 
Those obsolete functions are in there because there are still a lot of modules out there that were programmed before the newest release of DNN. Users would be pretty annoyed if all these stopped working merely because there's a new version of DNN. (Like: Upgrade your Windows version, and apps won't work any more. Not a good idea.)

I've got a problem with the SendMail routine. It keeps telling me
"Object CDO.Message could not be accessed" (or something like it, my error string is in German).
What's wrong? Is my IIS installation faulty or what? I know for a fact that the settings I typed in are correct. Moreover, *sometimes*, very rarely, a mail gets sent although I get the message.
I should mention I'm using DNN 3.1.1 since I've got some custom-written modules and don't want to upgrade to 3.2.2 because I'm afraid they'll stop working altogether (see above )

md
 
Previous Previous
 
Next Next
  Forum  General DotNetN...  Extend It! ( Pr...  Send Email From Custom Module
 


Forum Policy

These Discussion Forums are dedicated to the discussion of the DotNetNuke Web Application Framework.

For the benefit of the community and to protect the integrity of the project, 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 DotNetNuke.
2. Discussion or promotion of DotNetNuke product releases under a different brand name are strictly prohibited.
3. No Flaming or Trolling.
4. No Profanity, Racism, or Prejudice.
5. Site Moderators have the final word on approving/removing a thread or post or comment.
6. English language posting only, please.

 


SSL Enabled and Amazingly FAST...
SSL enable your DNN web site with SSLRedirect, compress your DNN web site HTTP data flow by up to 75%-90% with HttpCompressionAgent, and monitor your DNN web site's performance with WebKeepAlive...
www.sanibellogic.com
Ultra Media Gallery & Video Gallery
The most popular photo gallery and video gallery module. with Flash interface.
www.bizmodules.net
WDK Solutions
Quality modules for the DotNetNuke community. Check out our 'wild' modules!
wdkns.com

DotNetNuke Corporation   Terms Of Use  Privacy Statement
DotNetNuke®, DNN®, and the DotNetNuke logo are trademarks of DotNetNuke Corporation
Hosted by MaximumASP