whats not right?

starcraft

Centurion
Joined
Jun 29, 2003
Messages
167
Location
Poway CA
whats wrong with my mail send option? its not working
Visual Basic:
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
 
Last edited:
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.
Visual Basic:
Dim message As New MailMessage()
message.To = "personsemail"
 
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
Visual Basic:
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
 
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:
Visual Basic:
Imports System.Web.Mail
Put that on the top of your code.
 
Put it at the top of the code area
Visual Basic:
Option Strict On
Option Explicit On
Imports System.Web.Mail

Public Class Form1
   '...
 
U must put it in the form u are calling where U create the mail message ;)
Because it need to know what "message" is.
 
Back
Top