Jump to content
Xtreme .Net Talk

Recommended Posts

Posted (edited)

whats wrong with my mail send option? its not working

Dim mailmessage As mailmessage()
       MailMessage.To = ""
       MailMessage.From = TextBox4.Text
       MailMessage.Subject = "New Member*"
       MailMessage.Body = "Username: " & Chr(13) & TextBox1.Text & Chr(13) & "Password: " & Chr(13) & TextBox2.Text & Chr(13) & "Thay are 13 or older" & Chr(13)

O and VB 'splash' text onto a screen? or does it have to be in a window

Edited by starcraft
  • *Experts*
Posted

You need to create a new instance of the MailMessage class, and you didnt fill in the .To field which specifies to whom the mail is sent.

Dim message As New MailMessage()
message.To = "personsemail"

Posted

o i know about the .to i just removed my e-mail when i pasted the text i'll change the code.

---------- now it says that mailmessage is not declared

Dim message As New MailMessage()
       Message.To = "someone@cox.net"
       Message.From = TextBox4.Text
       Message.Subject = "New Member*"
       Message.Body = "Username: " & Chr(13) & TextBox1.Text & Chr(13) & "Password: " & Chr(13) & TextBox2.Text & Chr(13) & "Thay are 13 or older" & Chr(13)

it has underlined only then MailMesage() in blue saying its not declarded

  • *Experts*
Posted

Did you reference the System.Web assembly?

You have to do that, and use the imports statement becuase you dont use the full path of the class. This is the Imports statement you need after referencing the System.Web:

Imports System.Web.Mail

Put that on the top of your code.

Posted

Put it at the top of the code area

Option Strict On
Option Explicit On
Imports System.Web.Mail

Public Class Form1
  '...

.Net allows software to be written for any version of Windows and not break like Unmanaged applications unless using Unmanaged procedures like APIs. If your program uses large amounts of memory but releases it when something else needs it, then what's the problem?

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...