1. If I wanted to send email based on polling of data held in an SQL db
hosted on a website, what would be the best way to do it?
(i.e purchase a dedicated server, write and install a service and get the
service to send to ISP's SMTP server ?)
2. If I wanted to connect to an SQL DB hosted on a website what would be the
best way ?
(open port and connect over SSL ?)
Thanks for any information
ScottScott,
Here is a simple function I wrote to send email in VB.NET. You were not
specific to any programming language.
Private Sub SendEmail(ByVal Path As String, Optional ByVal Body As
String = "", Optional ByVal Too As String = "default@.default.com")
Dim SendMessage As New SmtpClient
Dim Message As MailMessage = New
MailMessage("from@.somewhere.com", Too, "Foo", Body)
Dim App As Attachment
If Path.Length > 0 And File.Exists(Path) Then
App = New Attachment(Path)
Message.Attachments.Add(App)
End If
SendMessage.Host = "" 'ServerName or IP Address of SMTP Server
goes here.
SendMessage.Send(Message)
End Sub
This function was created in VS 2005 using the .net framework 2.0
Showing posts with label email. Show all posts
Showing posts with label email. Show all posts
Friday, February 10, 2012
connect to SQL db on website ? (+ send email)
1. If I wanted to send email based on polling of data held in an SQL db
hosted on a website, what would be the best way to do it?
(i.e purchase a dedicated server, write and install a service and get the
service to send to ISP's SMTP server ?)
2. If I wanted to connect to an SQL DB hosted on a website what would be the
best way ?
(open port and connect over SSL ?)
Thanks for any information
ScottScott,
Here is a simple function I wrote to send email in VB.NET. You were not
specific to any programming language.
Private Sub SendEmail(ByVal Path As String, Optional ByVal Body As
String = "", Optional ByVal Too As String = "default@.default.com")
Dim SendMessage As New SmtpClient
Dim Message As MailMessage = New
MailMessage("from@.somewhere.com", Too, "Foo", Body)
Dim App As Attachment
If Path.Length > 0 And File.Exists(Path) Then
App = New Attachment(Path)
Message.Attachments.Add(App)
End If
SendMessage.Host = "" 'ServerName or IP Address of SMTP Server
goes here.
SendMessage.Send(Message)
End Sub
This function was created in VS 2005 using the .net framework 2.0
hosted on a website, what would be the best way to do it?
(i.e purchase a dedicated server, write and install a service and get the
service to send to ISP's SMTP server ?)
2. If I wanted to connect to an SQL DB hosted on a website what would be the
best way ?
(open port and connect over SSL ?)
Thanks for any information
ScottScott,
Here is a simple function I wrote to send email in VB.NET. You were not
specific to any programming language.
Private Sub SendEmail(ByVal Path As String, Optional ByVal Body As
String = "", Optional ByVal Too As String = "default@.default.com")
Dim SendMessage As New SmtpClient
Dim Message As MailMessage = New
MailMessage("from@.somewhere.com", Too, "Foo", Body)
Dim App As Attachment
If Path.Length > 0 And File.Exists(Path) Then
App = New Attachment(Path)
Message.Attachments.Add(App)
End If
SendMessage.Host = "" 'ServerName or IP Address of SMTP Server
goes here.
SendMessage.Send(Message)
End Sub
This function was created in VS 2005 using the .net framework 2.0
Subscribe to:
Posts (Atom)