Sunday, May 15, 2016

Website CAREER FORM with send mail,attached resume and linked resume

Imports System.Data.OleDb
Imports System.Data
Imports System.Web.Configuration
Imports System.Web.UI.HtmlControls.HtmlGenericControl
Imports System.Web.HttpApplication
Imports System.Drawing
Imports System.Net.Mail



Dim mail As New MailMessage()
        mail.From = New MailAddress("" & txtemail.Text & "")
        mail.To.Add("kapil@afflatusgravure.com")

        Dim sb As New StringBuilder
        FileUpload1.SaveAs(Server.MapPath("~/RESUMES/") & FileUpload1.FileName)
        Dim file As String = (Server.MapPath("~/RESUMES/") & FileUpload1.FileName)
        sb.Append("<a href=" & file & ">" & txtname.Text & "_" & "RESUME</a>")
        mail.Subject = ddlist1.Text
        mail.Body = "Name:" & " " & txtname.Text & "<br/>" & "Mobile:" & " " & txtmobile.Text & "<br/>" & "E-Mail:" & " " & txtemail.Text & "<br/>" & "Date Of Birth:" & " " & txtdob.Text & " <br/>" & "Applied For:" & " " & ddlist1.Text & "<br/>" & "Qualification:" & " " & txtqualification.Text & "<br/>" & "Skills:" & " " & txtskills.Text & "<br/>" & "Experience:" & " " & txtexperience.Text & "<br/>" & "Remarks:" & " " & txtremarks.Text & "<br/>" & "Resume:" & " " & sb.ToString()


        mail.IsBodyHtml = True

 //if u want ATTACHED RESUME with mail

        'If Not file = "" Then
        '    Dim MsgAttach As New Attachment(file)
        '    mail.Attachments.Add(MsgAttach)
        'End If

  Dim smtp As New SmtpClient("103.245.119.210")
        smtp.Send(mail)




             Image1.Visible = True
        txtdob.Text = ""
        txtemail.Text = ""
        txtexperience.Text = ""
        txtmobile.Text = ""
        txtname.Text = ""
        txtqualification.Text = ""
        txtremarks.Text = ""
        txtskills.Text = ""

//FOR ACCEPT DOC/MSWORD ONLY with fileupload control

 If (
            FileUpload1.PostedFile.ContentType = "text/rtf" Or
        FileUpload1.PostedFile.ContentType = "application/doc" Or
        FileUpload1.PostedFile.ContentType = "appl/text" Or
         FileUpload1.PostedFile.ContentType = "application/vnd.msword" Or
         FileUpload1.PostedFile.ContentType = "application/vnd.ms-word" Or
         FileUpload1.PostedFile.ContentType = "application/winword" Or
         FileUpload1.PostedFile.ContentType = "application/word" Or
         FileUpload1.PostedFile.ContentType = "application/msword" Or
         FileUpload1.PostedFile.ContentType = "application/x-msw6" Or
         FileUpload1.PostedFile.ContentType = "application/x-msword"
            ) Then

No comments: