Wrox Programmer Forums

Need to download code?

View our list of code downloads.

| FAQ | Members List | Search | Today's Posts | Mark Forums Read
BOOK: Beginning VB.NET 2nd Edition/Beginning VB.NET 2003
This is the forum to discuss the Wrox book Professional VB.NET 2003 by Bill Evjen, Billy Hollis, Rockford Lhotka, Tim McCarthy, Jonathan Pinnock, Rama Ramachandran, Bill Sheldon; ISBN: 9780764559921
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning VB.NET 2nd Edition/Beginning VB.NET 2003 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
DRM-free e-books 300x50
 
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old March 14th, 2006, 03:49 AM
Registered User
 
Join Date: Mar 2006
Location: ahmedabad, gujarat, India.
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Default urgent (in vb.net)


i have to send a message(not mail) form to a particular id
from within my windows form in vb.net.

i have used webbrowser control to access web sites.

please help in getting these things done.

renju
  #2 (permalink)  
Old March 14th, 2006, 07:32 AM
Thearon's Avatar
Wrox Author
 
Join Date: Dec 2003
Location: Fuquay Varina, NC, USA.
Posts: 396
Thanks: 0
Thanked 8 Times in 8 Posts
Default

I'm not sure what kind of message you want to send but you can open the MSDN library that shipped with Visual Studio 2003, click on the index tab and type "message." There is a wealth of information about sending messages to other Windows applications. The Process class can also be useful as well as the System.Diagnostics namespace.

I hope this helps.

Thearon
  #3 (permalink)  
Old March 23rd, 2006, 08:57 AM
Registered User
 
Join Date: Mar 2006
Location: ahmedabad, gujarat, India.
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Default

hello Theoren,

That was a good help.

but there a new problem arised.

We have used mailmessage and SMTP Server to send mail

from vb.net windows form to any id(to renjininair_2000@yahoo.co.in).

there is no error but i m not receiving the mail.

we tried to use TcpClient also but even that didnt help.

We are not sure what to assign as "SmtpServer".

What should be the IP Address and Port address.






renju
  #4 (permalink)  
Old March 23rd, 2006, 11:57 AM
Thearon's Avatar
Wrox Author
 
Join Date: Dec 2003
Location: Fuquay Varina, NC, USA.
Posts: 396
Thanks: 0
Thanked 8 Times in 8 Posts
Default

Renju,

The SmtpServer parameter should either be the DNS name or IP address of your outbound mail server.

Thearon
  #5 (permalink)  
Old March 25th, 2006, 07:47 AM
Registered User
 
Join Date: Mar 2006
Location: ahmedabad, gujarat, India.
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Default

hello Theoron,
please give me some example.


renju
  #6 (permalink)  
Old March 27th, 2006, 10:35 PM
Thearon's Avatar
Wrox Author
 
Join Date: Dec 2003
Location: Fuquay Varina, NC, USA.
Posts: 396
Thanks: 0
Thanked 8 Times in 8 Posts
Default

'Set the SmtpMail properties and send the mail message
SmtpMail.SmtpServer = smtpserver.domain.com
SmtpMail.Send(objMailMessage)
  #7 (permalink)  
Old March 29th, 2006, 09:47 AM
Registered User
 
Join Date: Mar 2006
Location: ahmedabad, gujarat, India.
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi Thearon,
I am using SmtpClient properties.
not SmtpServer.

code is something like this:


Imports System.Net.Mail
Public Class Form1

    'Inside the form’s code window:

    Public Sub SendAnEmail(ByVal MsgFrom As String, ByVal MsgTo As String, ByVal MsgSubject As String, ByVal MsgBody As String)

        Try

            ' Pass in the message information to a new MailMessage

            Dim msg As New Net.Mail.MailMessage(MsgFrom, MsgTo, MsgSubject, MsgBody)



            ' Create an SmtpClient to send the e-mail

            Dim mailClient As New SmtpClient("127.0.0.1") ' = local machine IP Address

            ' Use the Windows credentials of the current User

            mailClient.UseDefaultCredentials = True



            ' Pass the message to the mail server

            mailClient.Send(msg)



            ' Optional user reassurance:

            MessageBox.Show(String.Format("Message Subject ' {0} ' successfully sent From {1} To {2}", MsgSubject, MsgFrom, MsgTo), "EMail", Windows.Forms.MessageBoxButtons.OK, Windows.Forms.MessageBoxIcon.Information)



            ' Housekeeping

            msg.Dispose()



        Catch ex As FormatException

            MessageBox.Show(ex.Message & " :Format Exception")

        Catch ex As SmtpException

            MessageBox.Show(ex.Message & " :SMTP Exception")

        End Try



    End Sub

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        SendAnEmail("punitsingh_it@yahoo.co.in", "renjininair_2000@yahoo.co.in", "only testing for email sending", "nothing")
    End Sub
End Class






renju
  #8 (permalink)  
Old March 29th, 2006, 09:12 PM
Thearon's Avatar
Wrox Author
 
Join Date: Dec 2003
Location: Fuquay Varina, NC, USA.
Posts: 396
Thanks: 0
Thanked 8 Times in 8 Posts
Default

I've not used that class personally. Do a search on Google for SmtpClient. You'll get lots of hits with some pretty good links.

Thearon
  #9 (permalink)  
Old March 30th, 2006, 11:20 AM
Registered User
 
Join Date: Mar 2006
Location: ahmedabad, gujarat, India.
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Default

hi thearon

thank you

I got good help from you
I ll reply to you if I get exactly what i want

thanks again

renju
  #10 (permalink)  
Old March 30th, 2006, 11:24 AM
Registered User
 
Join Date: Mar 2006
Location: Ahmedabad, Gujarat, India.
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to Punit Singh
Default

hi Thearon

thank you for help.
I have also the same problem.
Can you give me the code of smtpserver mail sending.

Punit singh
 


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Urgent: Excel and Vb 6.0 ivanlaw Pro VB 6 5 October 22nd, 2007 03:34 AM
Urgent :VB ivanlaw Pro VB Databases 19 August 31st, 2007 08:09 PM
New to VB/Database (Urgent) FrancisEnem VB Databases Basics 3 December 11th, 2006 03:11 PM
Urgent VB form Migration to VB.net form kvenkat_2k1 Pro VB.NET 2002/2003 1 December 7th, 2005 04:58 PM
Biztalk Project in VB.Net( Urgent) sathak General .NET 0 August 29th, 2004 07:59 AM



All times are GMT -4. The time now is 06:45 AM.


Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.