Solved

FTP & Email

Posted on 2007-03-23
4
196 Views
Last Modified: 2010-04-23
FTP and Email, in VB6 Iused to have to use a third party component to FTP text files to a site, is there an option within VB.NET 2005 to achieve this.

Also what options do I have when sending emails from within the framework?
 
0
Comment
Question by:rocky050371
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
4 Comments
 
LVL 28

Accepted Solution

by:
iboutchkine earned 500 total points
ID: 18781965
FTP - Upload file
My.Computer.Network.UploadFile( _
                "File to upload", _
                "ftp://ftp-address" & _
                "/path/filename".mdb", _
                "ftp-username", "ftp-password", True, 5000)
-------------------------------------------------
email
Private Sub Button7_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button7.Click
        If Me.funEMail("bla@zzz.com", "xxx@yyy.com", "test", "test from 2005") Then
            MsgBox("success")
        Else
            MsgBox("failed")
        End If
  End Sub

    Private Function funEMail(ByVal sFrom As String, ByVal sTO As String, ByVal sSubject As String, ByVal sBody As String)
        Try
            Dim msg As New System.Net.Mail.MailMessage
            Dim addressFrom As New System.Net.Mail.MailAddress(sFrom)
            Dim addressTo As New System.Net.Mail.MailAddress(sTO)
            msg.From = addressFrom
            msg.To.Add(addressTo)
            msg.Subject = sSubject
            msg.Body = sBody
            Dim smtp As System.Net.Mail.SmtpClient = New System.Net.Mail.SmtpClient
            smtp.Host = "yourhost.com"
            smtp.Send(msg)
        Catch ex As Exception ' do noting for now
            MsgBox(Err.Description)
            Return False
        End Try
        Return True
    End Function
0
 
LVL 4

Expert Comment

by:rwaldicott
ID: 19034023
you could use a .NET component for FTP

http://www.jscape.com/sftpdotnet/

0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…

636 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question