Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9249455
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T10:11:38+00:00 2026-06-18T10:11:38+00:00

Hi im trying to send a notification email when event took a place, but

  • 0

Hi im trying to send a notification email when event took a place, but the problem is the email marked as spam and listed in junk mail, How can avoid junk mail and send email direct to inbox 🙂

Here is my code:

    Function SendResignEmail(PF As String, User As String, First_Name As String, Last_Name As String, Unit As String, EndDate As Date, Reason As String, JMTS As String, EmailTo() As String, EmailCC() As String, EmailSub As String)
    Dim EmailBody As String = "<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Transitional//EN' 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd'><html xmlns='http://www.w3.org/1999/xhtml'><head><meta content='en-us' http-equiv='Content-Language' /><meta content='text/html; charset=utf-8' http-equiv='Content-Type' /><title>Untitled 1</title><style type='text/css'> p.MsoNormal    {margin-bottom:.0001pt; font-size:11.0pt;   font-family:'Calibri','sans-serif'; margin-left: 0in;   margin-right: 0in;  margin-top: 0in;} table.MsoNormalTable  {font-size:10.0pt;  font-family:'Times New Roman','serif';}a:link   {color:blue;    text-decoration:underline;  text-underline:single;}.auto-style1 {   font-family: Arial, sans-serif; font-size: 10pt;    color: #9B5F9B;}</style></head><body><p class='MsoNormal'><span style='color:black'>Dear team,</span></p><p class='MsoNormal'><span style='color:black'><o:p>&nbsp;</o:p></span></p><p class='MsoNormal'><span style='color:black'><o:p>&nbsp;</o:p></span></p><p class='MsoNormal'><span style='color:black'>Kindly be informed that the below agent had resigned and his last working day is " & EndDate.ToShortDateString & " </span><b><span style='font-size:12.0pt;color:black'>.</span></b><span style='color:black'><o:p></o:p></span></p><p class='MsoNormal'><span style='color:black'><o:p>&nbsp;</o:p></span></p><table border='0' cellpadding='0' cellspacing='0' class='MsoNormalTable' style='width:491.55pt;margin-left:-1.15pt;border-collapse:collapse;mso-yfti-tbllook: 1184;mso-padding-alt:0in 0in 0in 0in' width='655'>   <tr style='mso-yfti-irow:0;mso-yfti-firstrow:yes;height:15.75pt'>       <td nowrap style='width: 48.0pt; border: solid windowtext 1.0pt; border-bottom: none; background: #CCC0DA; padding: 0in 5.4pt 0in 5.4pt; height: 15.75pt' width='64'>       <p align='center' class='MsoNormal' style='text-align:center'>      <span style='color:black'>User<o:p></o:p></span></p>        </td>       <td nowrap style='width: 48.0pt; border-top: solid windowtext 1.0pt; border-left: none; border-bottom: none; border-right: solid windowtext 1.0pt; background: #CCC0DA; padding: 0in 5.4pt 0in 5.4pt; height: 15.75pt' width='64'>      <p align='center' class='MsoNormal' style='text-align:center'>      <span style='color:black'>PF<o:p></o:p></span></p>      </td>       <td nowrap style='width: 138.75pt; border-top: solid windowtext 1.0pt; border-left: none; border-bottom: none; border-right: solid windowtext 1.0pt; background: #CCC0DA; padding: 0in 5.4pt 0in 5.4pt; height: 15.75pt' width='185'>       <p align='center' class='MsoNormal' style='text-align:center'>      <span style='color:black'>Name<o:p></o:p></span></p>        </td>       <td nowrap style='width: 85.5pt; border-top: solid windowtext 1.0pt; border-left: none; border-bottom: none; border-right: solid windowtext 1.0pt; background: #CCC0DA; padding: 0in 5.4pt 0in 5.4pt; height: 15.75pt' width='114'>     <p align='center' class='MsoNormal' style='text-align:center'>      <span style='color:black'>Area<o:p></o:p></span></p>        </td>       <td nowrap style='width: 43.05pt; border-top: solid windowtext 1.0pt; border-left: none; border-bottom: none; border-right: solid windowtext 1.0pt; background: #CCC0DA; padding: 0in 5.4pt 0in 5.4pt; height: 15.75pt' width='57'>     <p align='center' class='MsoNormal' style='text-align:center'>      <span style='color:black'>End Date<o:p></o:p></span></p>        </td>       <td nowrap style='width: 70.2pt; border-top: solid windowtext 1.0pt; border-left: none; border-bottom: none; border-right: solid windowtext 1.0pt; background: #CCC0DA; padding: 0in 5.4pt 0in 5.4pt; height: 15.75pt' width='94'>      <p align='center' class='MsoNormal' style='text-align:center'>      <span style='color:black'>Reason<o:p></o:p></span></p>      </td>       <td style='width: 58.05pt; border-top: solid windowtext 1.0pt; border-left: none; border-bottom: none; border-right: solid windowtext 1.0pt; background: #CCC0DA; padding: 0in 5.4pt 0in 5.4pt; height: 15.75pt' width='77'>        <p align='center' class='MsoNormal' style='text-align:center'>      <span style='color:black'>Mob #<o:p></o:p></span></p>       </td>   </tr>   <tr style='mso-yfti-irow:1;mso-yfti-lastrow:yes;height:15.75pt'>        <td nowrap style='width:48.0pt;border:solid windowtext 1.0pt;  padding:0in 5.4pt 0in 5.4pt;height:15.75pt' width='64'>      <p align='center' class='MsoNormal' style='text-align:center'>      <span style='font-size:9.0pt;font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;;color:black'>        6303<o:p></o:p></span></p>      </td>       <td nowrap style='width:48.0pt;border:solid windowtext 1.0pt;  border-left:none;padding:0in 5.4pt 0in 5.4pt;height:15.75pt' width='64'>     <p align='center' class='MsoNormal' style='text-align:center'>      <span style='font-size:9.0pt;font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;;color:black'>        " & PF & "<o:p></o:p></span></p>        </td>       <td nowrap style='width:138.75pt;border:solid windowtext 1.0pt;  border-left:none;padding:0in 5.4pt 0in 5.4pt;height:15.75pt' width='185'>      <p align='center' class='MsoNormal' style='text-align:center'>      <span style='color:black'>" & First_Name & " " & Last_Name & "</span><span style='font-size:9.0pt;  font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;;color:black'><o:p></o:p></span></p>       </td>       <td nowrap style='width:85.5pt;border:solid windowtext 1.0pt;  border-left:none;padding:0in 5.4pt 0in 5.4pt;height:15.75pt' width='114'>        <p align='center' class='MsoNormal' style='text-align:center'>      <span style='color:black'>" & Unit & "<o:p></o:p></span></p>        </td>       <td nowrap style='width:43.05pt;border:solid windowtext 1.0pt;  border-left:none;padding:0in 5.4pt 0in 5.4pt;height:15.75pt' width='57'>        <p align='center' class='MsoNormal' style='text-align:center'>      <span style='color:black'>" & EndDate.Day & "/" & EndDate.Month & "/" & EndDate.Year & "<o:p></o:p></span></p>      </td>       <td nowrap style='width:70.2pt;border:solid windowtext 1.0pt;  border-left:none;padding:0in 5.4pt 0in 5.4pt;height:15.75pt' width='94'>     <p align='center' class='MsoNormal' style='text-align:center'>      <span style='color:black'>" & Reason & "<o:p></o:p></span></p>      </td>       <td style='width:58.05pt;border:solid windowtext 1.0pt;border-left:  none;padding:0in 5.4pt 0in 5.4pt;height:15.75pt' width='77'>       <p align='center' class='MsoNormal' style='text-align:center'>      <span style='color:black'>" & JMTS & "<o:p></o:p></span></p>        </td>   </tr></table><p class='MsoNormal'><span style='color:black'><o:p>&nbsp;</o:p></span></p><p class='MsoNormal'><span style='color:#1F497D'><o:p>&nbsp;</o:p></span></p><p class='MsoNormal'><span style='color:black'>For your kind action if any .<o:p></o:p></span></p><p class='MsoNormal'><span style='color:#1F497D'><o:p>&nbsp;</o:p></span></p><p class='MsoNormal'><span style='color:#1F497D'><o:p>&nbsp;</o:p></span></p><p class='MsoNormal'>Thanks!</p><p class='MsoNormal'>&nbsp;</p><p class='MsoNormal'><o:p>&nbsp;</o:p></p><p class='MsoNormal'><span style='font-size:10.0pt;font-family:&quot;Verdana&quot;,&quot;sans-serif&quot;;color:black'><img height='80' src=cid:companylogo width='52' /><!--[if gte vml 1]><v:shapetype id='_x0000_t75' coordsize='21600,21600' o:spt='75' o:preferrelative='t' path='m@4@5l@4@11@9@11@9@5xe' filled='f' stroked='f'><v:stroke joinstyle='miter' xmlns:v='urn:schemas-microsoft-com:vml'/><v:formulas><v:f eqn='if lineDrawn pixelLineWidth 0' xmlns:v='urn:schemas-microsoft-com:vml'/><v:f eqn='sum @0 1 0' xmlns:v='urn:schemas-microsoft-com:vml'/><v:f eqn='sum 0 0 @1' xmlns:v='urn:schemas-microsoft-com:vml'/><v:f eqn='prod @2 1 2' xmlns:v='urn:schemas-microsoft-com:vml'/><v:f eqn='prod @3 21600 pixelWidth' xmlns:v='urn:schemas-microsoft-com:vml'/><v:f eqn='prod @3 21600 pixelHeight' xmlns:v='urn:schemas-microsoft-com:vml'/><v:f eqn='sum @0 0 1' xmlns:v='urn:schemas-microsoft-com:vml'/><v:f eqn='prod @6 1 2' xmlns:v='urn:schemas-microsoft-com:vml'/><v:f eqn='prod @7 21600 pixelWidth' xmlns:v='urn:schemas-microsoft-com:vml'/><v:f eqn='sum @8 21600 0' xmlns:v='urn:schemas-microsoft-com:vml'/><v:f eqn='prod @7 21600 pixelHeight' xmlns:v='urn:schemas-microsoft-com:vml'/><v:f eqn='sum @10 21600 0' xmlns:v='urn:schemas-microsoft-com:vml'/></v:formulas><v:path o:extrusionok='f' gradientshapeok='t' o:connecttype='rect' xmlnsv='urn:schemas-microsoft-com:vml'/><o:lock v:ext='edit' aspectratio='t' xmlns:o='urn:schemas-microsoft-com:office:office'/></v:shapetype><![endif]--><![if !vml]><![endif]><br />&nbsp;</span><span style='font-size:12.0pt;font-family:&quot;Arial&quot;,&quot;sans-serif&quot;;color:#9B5F9B'><br />Contact Center Notifications on behalf of " & Name & "</span><span style='font-size:10.0pt;font-family:&quot;Arial&quot;,&quot;sans-serif&quot;;color:black'> </span><span style='font-size:12.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;'><o:p></o:p></span></p><p class='MsoNormal' style='margin-bottom:12.0pt'><span class='auto-style1'>Headcount</span><span style='font-size:10.0pt;font-family:&quot;Arial&quot;,&quot;sans-serif&quot;;color:#9B5F9B'><br /><br />Zain Jordan <br />PO Box 940821, Amman 11194, Jordan</span><span style='font-size:12.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;'><o:p></o:p></span></p><p class='MsoNormal' style='margin-bottom:12.0pt'></p></body></html>"
    Try
        Dim SmtpServer As New SmtpClient()
        Dim mail As New MailMessage()
        SmtpServer.Credentials = New Net.NetworkCredential("CCNotifications@xxxxx.com", "xxxxxx")
        SmtpServer.Port = 25
        SmtpServer.Host = "192.168.10.232"
        mail = New MailMessage()

        Dim plainView As AlternateView = AlternateView.CreateAlternateViewFromString(System.Text.RegularExpressions.Regex.Replace(EmailBody, "@<(.|\n)*?>", String.Empty), Nothing, "text/plain")
        Dim htmlView As AlternateView = AlternateView.CreateAlternateViewFromString(EmailBody, Nothing, "text/html")


        'create the LinkedResource (embedded image) 
        Dim logo As New LinkedResource("\\fastdell\users\sales\users\lo'ais\Head_Count\IMG\Zain_logo.jpg")
        logo.ContentId = "companylogo"
        'add the LinkedResource to the appropriate view 
        htmlView.LinkedResources.Add(logo)
        plainView.LinkedResources.Add(logo)

        mail.BodyEncoding = System.Text.Encoding.GetEncoding("utf-8")
        'add the views 

        mail.AlternateViews.Add(htmlView)
        mail.AlternateViews.Add(plainView)


        mail.From = New MailAddress("CCNotifications@xxxx.com", "CC Notifications")
        For i As Integer = 0 To EmailTo.Length - 1
            mail.To.Add(EmailTo(i))
        Next
        For i As Integer = 0 To EmailCC.Length - 1
            mail.CC.Add(EmailCC(i))
        Next
        'mail.Bcc.Add("wall.of.ey3s@gmail.com")

        mail.Subject = EmailSub
        mail.IsBodyHtml = True
        'mail.Body = EmailBody

        SmtpServer.Send(mail)
        'MsgBox("mail send")
    Catch ex As Exception
        MsgBox(ex.ToString)
    End Try
    Return Nothing
End Function

Thanks!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T10:11:40+00:00Added an answer on June 18, 2026 at 10:11 am

    The code that sends the mail has no influence on whether the receiving mail server interprets your mail as spam. Just think about it. That would render all anti-spam measures useless, because spammers would simply us that functionality, too.

    The only thing you can do is to add the senders mail address to the list of known addresses. But that has to be done on the receiving server’s side – again, nothing your program can control.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to send push notification to iPhone using Java-pns but I am
Am trying to create a java project which can able to send push notification
I am trying to send notification emails(which is working fine) but have added the
HI, I am trying to send a simple notification using system.net.mail.mailmessage. I just pass
I'm trying to send push notification to Android devices, but getting an error in
Trying to send some email in my C# app. I am behind a proxy
I`m trying to send e-mail via c# and use the following code: public static
I am trying to send a sample email from my rails application. this is
I am trying to send a Facebook notification from my app using Graph API
I'm trying send push notifications, but the APNS send me this response: Resource id

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.