Solved

FTP & Email

Posted on 2007-03-23
4
189 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
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: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering 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

1.0 - Introduction Converting Visual Basic 6.0 (VB6) to Visual Basic 2008+ (VB.NET). If ever there was a subject full of murkiness and bad decisions, it is this one!   The first problem seems to be that people considering this task of converting…
The ECB site provides FX rates for major currencies since its inception in 1999 in the form of an XML feed. The files have the following format (reducted for brevity) (CODE) There are three files available HERE (http://www.ecb.europa.eu/stats/exch…
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…

830 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