Results 1 to 7 of 7

Thread: Fake Email Sender

  1. #1

    Thread Starter
    Lively Member
    Join Date
    May 2008
    Posts
    95

    Fake Email Sender

    I have this code to send an email:
    Code:
    Imports System.Net.Mail
    Public Class Form1
    
        Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
            If msgTo.Text = "" Or msgFrom.Text = "" Or msgSubject.Text = "" Or msgBody.Text = "" Or smtpHost.Text = "" Or smtpPort.Text = "" Then
                MsgBox("You must fill out everything!", MsgBoxStyle.Information, "Error")
                Exit Sub
            End If
            On Error GoTo msgError
            Dim smtpServer As New SmtpClient()
            Dim mail As New MailMessage()
            smtpServer.Credentials = New Net.NetworkCredential("email", "password")
            smtpServer.Port = smtpPort.Text
            smtpServer.Host = smtpHost.Text
            If SSL.Checked = True Then
                smtpServer.EnableSsl = True
            Else
                smtpServer.EnableSsl = False
            End If
            smtpServer.EnableSsl = SSL.Checked
            mail = New MailMessage()
            mail.From = New MailAddress(msgFrom.Text)
            mail.To.Add(msgTo.Text)
            mail.Subject = msgSubject.Text
            mail.Body = msgBody.Text
            smtpServer.Send(mail)
            MsgBox("Email was sent to:" & msgTo.Text)
            Exit Sub
    msgError:
            MsgBox("Couldn't send email, please make sure the SMTP Settings are correct.", MsgBoxStyle.Critical, "Error")
        End Sub
    
        Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
            smtpHost.Text = "smtp.live.com"
        End Sub
    End Class
    But obviously, it sends them an email from the email that requires the password.

    But I want to send emails that appear from what's entered in the 'from' textbox.

    How would I go about that?

  2. #2
    PowerPoster Radjesh Klauke's Avatar
    Join Date
    Dec 2005
    Location
    Sexbierum (Netherlands)
    Posts
    2,244

    Re: Fake Email Sender

    It seems like to me that, it also count for this poster, lately people are asking how to disguise or how to "hack" a php-form. Where are we going to? Fortunately there are enough people who ask "normal" questions. Thanks for that.

    Now back to topic: Where do you want to get the password from?


    If you found my post helpful, please rate it.

    Codebank Submission: FireFox Browser (Gecko) in VB.NET, Load files, (sub)folders treeview with Windows icons

  3. #3
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: Fake Email Sender

    It's got nothing to do with the email address. It's the SMTP server that's the issue. You can send email from any address you want. What matters is that the system sending the message is authorised to do so on the specified SMTP server. The credentials you are supplying are for the SMTP account, not for the email address.

    That said, it may be that some SMTP servers reject messages from a domain other than their own. If so then, again, that's down to the SMTP server and nothing inherent in the SMTP protocol or the System.Net.Mail namespace.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  4. #4

    Thread Starter
    Lively Member
    Join Date
    May 2008
    Posts
    95

    Re: Fake Email Sender

    Do you know any smtp servers that don't need authorization?

  5. #5
    PowerPoster Radjesh Klauke's Avatar
    Join Date
    Dec 2005
    Location
    Sexbierum (Netherlands)
    Posts
    2,244

    Re: Fake Email Sender

    ??? 99,9% of the SMPT servers need authorization.


    If you found my post helpful, please rate it.

    Codebank Submission: FireFox Browser (Gecko) in VB.NET, Load files, (sub)folders treeview with Windows icons

  6. #6

    Thread Starter
    Lively Member
    Join Date
    May 2008
    Posts
    95

    Re: Fake Email Sender

    Not really...

  7. #7
    Frenzied Member Pc_Not_Mac's Avatar
    Join Date
    Oct 2009
    Location
    localhost
    Posts
    1,206

    Re: Fake Email Sender

    Don't Spam people.
    My Codebank:
    Windows Vista & 7 Glass Effect & Limit the amount of times your application could be opened.
    Pause Your Code & Check the OS name

    The question of whether computers can think is like the question of whether submarines can swim.

    Currently learning: Java

    Coding can be a learning experience or

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width