Click here to Skip to main content
15,887,464 members
Please Sign up or sign in to vote.
2.00/5 (1 vote)
See more:
Hi you All, :)
Can anybody help me how to send the SMS and email via your own proxy server of VB.NET or ASP.NET project ...

you can send any article related to my stuff ..
Thank you..
Posted
Updated 21-Feb-11 18:03pm
v2
Comments
Ankur\m/ 22-Feb-11 0:11am    
What have you tried? Have you even tried searching for similar questions here (there are so many here).
Search Google and CodeProject. You will get lots of articles, helpful links and answers. Work on it. Put some effort and get back in case you have 'specific' issues.

 
Share this answer
 
Comments
Espen Harlinn 25-Feb-11 6:48am    
Good links, my 5
Imports System.Net
Imports System.Net.Mail
Imports System.Net.Mime

-------------------------------------
Private Sub Sender(ByVal From As String, ByVal DisplayName As String, ByVal SendTo As String, ByVal Message As String, ByVal Subject As String, ByVal Password As String, ByVal Attach As String)
Using mailMessage As New MailMessage(New MailAddress(SendTo), New MailAddress(SendTo))
mailMessage.Body = Message
mailMessage.Subject = Subject
Try
Dim SmtpServer As New SmtpClient()
SmtpServer.Credentials = New System.Net.NetworkCredential(From, Password)
SmtpServer.Port = 587

Dim MS() As String = From.ToString.Split("@")
Dim MailServer() As String = MS(1).ToString.Split(".")
Select Case UCase(MailServer(0))
Case Is = "GMAIL"
SmtpServer.Host = "smtp.gmail.com"
SmtpServer.EnableSsl = True
Case Is = "YAHOO"
SmtpServer.Host = "smtp.mail.yahoo.com"
SmtpServer.EnableSsl = False
Case Is = "AOL"
SmtpServer.Host = "smtp.aol.com"
SmtpServer.EnableSsl = False
Case Is = "LIVE"
SmtpServer.Credentials = New System.Net.NetworkCredential(From, Password)
SmtpServer.Host = "smtp.live.com"
SmtpServer.EnableSsl = True
End Select

mail = New MailMessage()
Dim addr() As String = SendTo.Split(",")
mail.From = New MailAddress(From, DisplayName, System.Text.Encoding.UTF8)
Dim i As Byte
For i = 0 To addr.Length - 1
mail.To.Add(addr(i))
Next i
mail.Subject = Subject
mail.Body = Message
mail.BodyEncoding = System.Text.Encoding.UTF7
If Attach.Length <> 0 Then
mail.Attachments.Add(New Attachment(Attach))
End If
mail.IsBodyHtml = True
mail.DeliveryNotificationOptions = DeliveryNotificationOptions.OnFailure
mail.ReplyTo = New MailAddress(SendTo)
SmtpServer.Send(mail)
Catch ex As Exception
MessageBox.Show(ex.Message, "EMail", MessageBoxButtons.OK, MessageBoxIcon.Exclamation)
End Try
End Using
End Sub
 
Share this answer
 
Did you try searching on the internet for this.
I did a search for VB.Net and sms and got tons of results.

This[^] was the first hit.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900