Public Class MyMail
    Dim MailFrom, Subject, Body, MailType, program As String
    Dim th As Threading.Thread
    Public Sub New(ByVal vmailfrom As String, ByVal vsubject As String, ByVal vbody As String, ByVal vMailType As String, ByVal vprogram As String)
        Me.MailFrom = vmailfrom
        Me.Subject = vsubject
        Me.Body = vbody
        Me.MailType = vMailType
        Me.program = vprogram
        th = New Threading.Thread(AddressOf AutoSendMail)
    End Sub
    Public Sub SendMail()
        th.Start()
    End Sub
    Private Sub AutoSendMail()
        Dim A As New Frm_SendMail
        A.Show()
        A.Validate()
        A.Update()

        Dim Buf As New System.Text.StringBuilder

        subject = "[" & MailType & "]" & subject

        Dim mailobj As New Net.Mail.MailMessage(MailFrom, "arin@tindevil.com")  '//여기메일서버는 나아니면 못받게되어잇다.
        mailobj.Subject = subject '//제목줄
        mailobj.BodyEncoding = System.Text.Encoding.Default
        mailobj.IsBodyHtml = False
        Buf.AppendLine("=======================")
        Buf.AppendLine("보내는사람 : " & mailfrom)
        Buf.AppendLine("프로그램명 : " & program)
        Buf.AppendLine("=======================")
        Buf.AppendLine("본문메세지")
        Buf.AppendLine(body)
        Buf.AppendLine("=======================")

        mailobj.Body = Buf.ToString
        Dim C As New Net.Mail.SmtpClient("mail.xtto.net")
        C.Send(mailobj)
        A.Dispose()
    End Sub

    Public Shared Sub SenMail2(ByVal P_subject As String, ByVal p_body As String)
        'smtp.hanmail.net
        Dim MM As New System.Net.Mail.MailMessage
        MM.From = New System.Net.Mail.MailAddress("tindevil@tindevil.com")
        MM.BodyEncoding = System.Text.Encoding.Default
        MM.To.Add("tindevil@hanmail.net")
        MM.Subject = P_subject
        MM.Body = p_body
        MM.IsBodyHtml = False
        MM.Priority = Net.Mail.MailPriority.Normal
        Dim SC As New System.Net.Mail.SmtpClient("uwa64-033.cafe24.com")
        SC.Credentials = New System.Net.NetworkCredential("tindevil", "Blue2506")
        'SC.EnableSsl = True
        SC.Send(MM)

    End Sub
End Class