473,322 Members | 1,493 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

Problem when sending E-mail in VS 2005

Expand|Select|Wrap|Line Numbers
  1. <summary>
  2.     Sends an mail message
  3. </summary>
  4. <param name="from">Sender address</param>
  5. <param name="recepient">Recepient address</param>
  6. <param name="subject">Subject of mail message</param>
  7.        Public Shared Sub SendMailMessage(ByVal from As String, ByVal recepient As String, ByVal subject As String)
  8.  
  9.         Dim mMailMessage As New MailMessage()
  10.  
  11.         mMailMessage.From = New MailAddress(from)
  12.  
  13.         mMailMessage.To.Add(New MailAddress(recepient))
  14.  
  15.         mMailMessage.Subject = subject
  16.  
  17.         mMailMessage.Body = "Hai"
  18.  
  19.         mMailMessage.IsBodyHtml = True
  20.  
  21.         mMailMessage.Priority = MailPriority.Normal
  22.  
  23.         Dim mSmtpClient As New SmtpClient("Gur436smail1.interglobetechnologies.copm")
  24.  
  25.         mSmtpClient.Send(mMailMessage)
  26.  
  27.     End Sub
  28.  
  29.  
  30.  
  31. <summary>
  32.  
  33. </summary>
  34. <param name="sender"></param>
  35. <param name="e"></param>
  36. <remarks></remarks>
  37. Protected Sub BtnSubmit_Click(ByVal sender As Object, ByVal e As System.Web.UI.ImageClickEventArgs) Handles BtnSubmit.Click
  38.  
  39.         Try
  40.  
  41.             objEmployee.fnEmpPersonelInformationUpdate()
  42.  
  43.             Dim strSubject As String = "Username and Password"
  44.  
  45.             SendMailMessage(Me.txtOMailID1.Text, Me.txtOMailID2.Text, strSubject)
  46.  
  47.         Catch ex As Exception
  48.  
  49. Throw ex
  50.  
  51.         End Try  'End of try catch block
  52.  
  53.     End Sub  'End of BtnSubmit_Click
Dec 7 '07 #1
3 851
debasisdas
8,127 Expert 4TB
What exactly is the error message that you are getting ?
Dec 7 '07 #2
kenobewan
4,871 Expert 4TB
Why are you using v1.1 code in v2.0? Seems like you copied & pasted from the wrong site.
Dec 7 '07 #3
Plater
7,872 Expert 4TB
Indeed, those aren't even the vs2005 XML comment tags.
Dec 7 '07 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: Efim | last post by:
Hi, I have got some problem with sending of events in .NET. I am using remouting. The client has got 2 objects for receiving different types of events (responses and events) The server has got...
0
by: Lynne | last post by:
I am using the C# asynchronous socket functionality for a server, and it appears to work fine if I just receive data and echo it back to the client. The problem occurs when I try to handle sending...
2
by: anonymous | last post by:
Hi, I'am sending an xml string to a web service(which is written in c#) using the microsoft web services behavior. When I check this string from the web service I observed that some of the...
1
by: Gidi | last post by:
Hi, i have a textBox that when it get focused i'm sending ALT+SHIFT (to change the current language) i compare the current language to the one i need (using InputLanguage.CurrentInputLanguage),...
4
by: yaron | last post by:
Hi, I have a problem when sending data over TCP socket from c# client to java server. the connection established ok, but i can't send data from c# client to java server. it's work ok with...
11
by: ASP newbie | last post by:
I cannot run my asp.net application in w2k server. But the program works fine under w2k professional. Can anyone tell me is there any difference in the settings? Many thanks.
2
by: Mr. x | last post by:
Hello, I have a problem of posting message to newsgroup server : news.microsoft.com. When I am sending the message directly via news.microsoft.com (using outlook express) there is a problem,...
1
by: Prosper0 | last post by:
Hello, I have a problem sending special characters from a form to another page. The sending page is in ISO-8859-1 (meta tag), and the recieving page too. (Using post) The characters show OK in...
0
by: Andrea | last post by:
Hi I've having a very strange problem using the SendInput API to send text to other applications. I've written the code and it seems to work well. I discovered a strange problem: when I try to...
9
by: darthghandi | last post by:
I am trying to create a server application using asynchronous sockets. I run into a problem when I try to connect to my server using a non-.net program. I can establish the connection, and send...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.