email sending with asp.net/vb.net 2.0

0 views
Skip to first unread message

Dhananjay

unread,
Feb 22, 2008, 8:27:22 AM2/22/08
to DotNetDevelopment, VB.NET, C# .NET, ADO.NET, ASP.NET, XML, XML Web Services,.NET Remoting
Hi all ,

I have notify.aspx page. On this page i have 10 textboxes with some
values coming from database.and i have also placed two buttons namely
send and save . when i click on send button, the mail is going to
target emailid(To).
but all the contents means textboxes values are not going with this
mail.
Only the parameters i have defiend in send method that parameters only
appears.
But i want all the 10 textboxes values to be sent to the email id that
means the web page(notify.aspx) control contents(textbox values).

this is my code which i have wrriten, please help me to solve the
problem or correct the code please.

Protected Sub btnSend_Click(ByVal sender As Object, ByVal e As
EventArgs)

Dim Mailmsg As New System.Net.Mail.MailMessage()

Dim MailServerName As String = "12.96.164.83"
Dim mSmtpClient As New Net.Mail.SmtpClient
mSmtpClient.Host = MailServerName
mSmtpClient.Port = 25
Mailmsg.IsBodyHtml = True

Try
mSmtpClient.Send("dhana...@OptimalSol.com",
"dhana...@OptimalSol.com", "Hi test mail", "Hello buddy")
Catch objException As Exception

End Try
End Sub


Thanks in advance
Dhananjay

Andrew Badera

unread,
Feb 22, 2008, 8:30:14 AM2/22/08
to DotNetDe...@googlegroups.com
arrrr, cap'n, I believe I've spotted a sunken exception ahead! shivvvver me timbers! the Exception Pirates got jumped by the Newb Ninjas!
--
--Andy Badera
http://andrew.badera.us/
and...@badera.us
(518) 641-1280
Google me: http://www.google.com/search?q=andrew+badera

Dhananjay

unread,
Feb 22, 2008, 9:55:58 AM2/22/08
to DotNetDevelopment, VB.NET, C# .NET, ADO.NET, ASP.NET, XML, XML Web Services,.NET Remoting
Hi,

I didn't understand what do you mean to say about my problem .
Can you please clarify it ?

Thanks


On Feb 22, 6:30 pm, "Andrew Badera" <and...@badera.us> wrote:
> arrrr, cap'n, I believe I've spotted a sunken exception ahead! shivvvver me
> timbers! the Exception Pirates got jumped by the Newb Ninjas!
>
> On 2/22/08, Dhananjay <dhananjay...@yahoo.co.in> wrote:
>
>
>
>
>
> > Hi all ,
>
> > I have notify.aspx page. On this page i have 10 textboxes with some
> > values coming from database.and i have also placed two buttons namely
> > send and save . when i click on send button, the mail is going to
> > target emailid(To).
> > but all the contents means textboxes values are not going with this
> > mail.
> > Only the parameters i have defiend in send method that parameters only
> > appears.
> > But i want all the 10 textboxes values to be sent to the email id that
> > means the web page(notify.aspx) control contents(textbox values).
>
> > this is my code which i have wrriten, please help me to solve the
> > problem or correct the code please.
>
> > Protected Sub btnSend_Click(ByVal sender As Object, ByVal e As
> > EventArgs)
>
> > Dim Mailmsg As New System.Net.Mail.MailMessage()
>
> > Dim MailServerName As String = "12.96.164.83"
> > Dim mSmtpClient As New Net.Mail.SmtpClient
> > mSmtpClient.Host = MailServerName
> > mSmtpClient.Port = 25
> > Mailmsg.IsBodyHtml = True
>
> > Try
> > mSmtpClient.Send("dhananja...@OptimalSol.com",
> > "dhananja...@OptimalSol.com", "Hi test mail", "Hello buddy")
> > Catch objException As Exception
>
> > End Try
> > End Sub
>
> > Thanks in advance
>
> > Dhananjay
>
> --
> --Andy Baderahttp://andrew.badera.us/

Michael O

unread,
Feb 22, 2008, 10:41:11 AM2/22/08
to DotNetDevelopment, VB.NET, C# .NET, ADO.NET, ASP.NET, XML, XML Web Services,.NET Remoting
What purpose does your Try serve other than to silently conceal every
run-time exception?

Peter Groenewegen

unread,
Feb 22, 2008, 5:40:11 PM2/22/08
to asp...@googlegroups.com, dotnetdevelopment
It looks like you are not registering your event handling properly. I guess it is only registering it the second time.
 
--
Peter

On Fri, Feb 22, 2008 at 2:28 PM, Dhananjay <dhanan...@yahoo.co.in> wrote:

Hi all ,

I have notify.aspx page. On this page i have 10 textboxes with some
values coming from database.and i have also placed two buttons namely
send and save . when i click on send button, the mail is going to
target emailid(To).
but all the contents means textboxes values are not going with this
mail.
Only the parameters i have defiend in send method that parameters only
appears.
But i want all the 10 textboxes values to be sent to the email id that
means the web page(notify.aspx) control contents(textbox values).

this is my code which i have wrriten, please help me to solve the
problem or correct the code please.

 Protected Sub btnSend_Click(ByVal sender As Object, ByVal e As
EventArgs)

 Dim Mailmsg As New System.Net.Mail.MailMessage()

       Dim MailServerName As String = "12.96.164.83"
       Dim mSmtpClient As New Net.Mail.SmtpClient
       mSmtpClient.Host = MailServerName
       mSmtpClient.Port = 25
       Mailmsg.IsBodyHtml = True

       Try
           mSmtpClient.Send("dhana...@OptimalSol.com",
"dhana...@OptimalSol.com", "Hi test mail", "Hello buddy")

Cerebrus

unread,
Feb 23, 2008, 2:00:03 AM2/23/08
to DotNetDevelopment, VB.NET, C# .NET, ADO.NET, ASP.NET, XML, XML Web Services,.NET Remoting
I do not see any place in the code where you are retrieving the values
of the textboxes. Have you left out that part purposely, or are you
expecting it to happen by magic ? And Michael's comment should make
you aware that you are planting mines in your own (code) garden.

On Feb 22, 6:27 pm, Dhananjay <dhananjay...@yahoo.co.in> wrote:
> Hi all ,
>
> I have notify.aspx page. On this page i have 10 textboxes with some
> values coming from database.and i have also placed two buttons namely
> send and save . when i click on send button, the mail is going to
> target emailid(To).
> but all the contents means textboxes values are not going with this
> mail.
> Only the parameters i have defiend in send method that parameters only
> appears.
> But i want all the 10 textboxes values to be sent to the email id that
> means the web page(notify.aspx) control contents(textbox values).
>
> this is my code which i have wrriten, please help me to solve the
> problem or correct the code please.
>
>  Protected Sub btnSend_Click(ByVal sender As Object, ByVal e As
> EventArgs)
>
>  Dim Mailmsg As New System.Net.Mail.MailMessage()
>
>         Dim MailServerName As String = "12.96.164.83"
>         Dim mSmtpClient As New Net.Mail.SmtpClient
>         mSmtpClient.Host = MailServerName
>         mSmtpClient.Port = 25
>         Mailmsg.IsBodyHtml = True
>
>         Try
>             mSmtpClient.Send("dhananja...@OptimalSol.com",
> "dhananja...@OptimalSol.com", "Hi test mail", "Hello buddy")
Reply all
Reply to author
Forward
0 new messages