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

HomeHomeArchived Discus...Archived Discus...Developing Under Previous Versions of .NETDeveloping Under Previous Versions of .NETASP.Net 2.0ASP.Net 2.0Sending Email in VB.Net 2.0Sending Email in VB.Net 2.0
Previous
 
Next
New Post
3/13/2008 5:57 PM
 



Manually using the following code for sending email transmissions:

        Protected Sub btnSubmit_Click(ByVal sender As Object, ByVal e As System.EventArgs)
            Try
                Dim message As New MailMessage(txtTo.Text, txtFtom.Text, txtSubject.Text, txtBody.Text)
                Dim emailClient As New SmtpClient("mail.yourmailserver.com")
                emailClient.Send(message)
                litStatus.Text = "Message Sent"
            Catch ex As Exception
                litStatus.Text = ex.ToString()
            End Try
        End Sub


The ASCX then has the appropriate TO, FROM, SUBJECT, and BODY textboxes.  
I am interested in collecting additional fields of data, making more textboxes in ASCX, and adding to code behind.
I manually added this, since it seemed like the logical addition to the coding, but it doesn't recognize the following addition:
Dim message As New MailMessage(txtTo.Text, txtFtom.Text, txtSubject.Text, txtBody.Text, txtAdditionalfield.Text)

How would the code behind be programmed, so multiple fields can be included in email?


Feedback Appreciated.

 
New Post
3/14/2008 4:48 AM
 

I suggest to use dotnetnuke.services.mail.mail.sendmail instead of .Net mail, this will use SMTP settings from Host Settings. 


Cheers from Germany,
Sebastian Leupold

dnnWerk - The DotNetNuke Experts   German Spoken DotNetNuke User Group

Speed up your DNN Websites with TurboDNN
 
New Post
3/14/2008 10:35 AM
 

If you want to include information from more than one input field you must format the body of the message before you call the "send" method for the e-mail.


-Mitchel Sellers
Microsoft MVP, ASPInsider, DNN MVP
CEO/Director of Development - IowaComputerGurus Inc.
LinkedIn Profile

Visit mitchelsellers.com for my mostly DNN Blog and support forum.

Visit IowaComputerGurus.com for free DNN Modules, DNN Performance Tips, DNN Consulting Quotes, and DNN Technical Support Services
 
New Post
3/14/2008 2:13 PM
 

I have manually coded this using php echo's in the past for bulk data collection, which gives control of emailed format, but am having trouble getting to work within ascx.vb codebehind.  Instead I have it reference the .PHP externally, and it seems to send, but "errors on page" appears in lower left of Inernet Explorer & form resets.
My server is running and supports PHP.  I would like to impliment directly within module's ascx and .vb code behind.

What do you recommend is the best method for gathering multiple fields of data & having control of final email output format?  (vb.net or php)
Any tutorials that may shed some light on this?  
Everything seems to be basic feedback related. No multiple Fields. No control of Output Format.

Feedback Appreciated.

 
New Post
3/14/2008 2:56 PM
 

Just create a string variable to hold the contents of the body of your e-mail by adding the values of the additional fields to the body of the e-mail - along with the applicable text.  This should be fairly straightforward unless I'm missing something.  I've done this with the DNN modules I've built without any problems.

As already mentioned, I would also recomment using dotnetnuke.services.mail.mail.sendmail instead of .Net mail.

 
Previous
 
Next
HomeHomeArchived Discus...Archived Discus...Developing Under Previous Versions of .NETDeveloping Under Previous Versions of .NETASP.Net 2.0ASP.Net 2.0Sending Email in VB.Net 2.0Sending Email in VB.Net 2.0


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