?
Solved

FTP & Email

Posted on 2007-03-23
4
Medium Priority
?
198 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 2000 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

Article by: jpaulino
XML Literals are a great way to handle XML files and the community doesn’t use it as much as it should.  An XML Literal is like a String (http://msdn.microsoft.com/en-us/library/system.string.aspx) Literal, only instead of starting and ending with w…
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…
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…
Suggested Courses

719 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