Advertisement
Guest User

Untitled

a guest
Oct 8th, 2015
123
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.16 KB | None | 0 0
  1. <%@ Import Namespace="System.Web.Mail" %>
  2.  
  3.  
  4.  
  5. <script language="VB" runat="server">
  6.  
  7. Sub Page_Load(Sender As Object, E As EventArgs)
  8.  
  9.  
  10.  
  11. Dim msg as New MailMessage()
  12.  
  13.  
  14.  
  15. msg.To = "rpavan89@gmail.com"
  16.  
  17. msg.From = "test@absolutecrm.in"
  18.  
  19. msg.Subject = "test"
  20.  
  21. 'msg.BodyFormat = MailFormat.Html
  22.  
  23. msg.BodyFormat = MailFormat.Text
  24.  
  25. msg.Body = "hi"
  26.  
  27.  
  28.  
  29.  
  30.  
  31. msg.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpserver", "150.129.116.210")
  32.  
  33. msg.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpserverport", 25)
  34.  
  35. msg.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendusing", 2)
  36.  
  37. msg.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate", "1")
  38.  
  39. msg.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendusername", "test@absolutecrm.in")
  40.  
  41. msg.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendpassword", "ctrls.123")
  42.  
  43.  
  44.  
  45.  
  46. ' SmtpMail.SmtpServer = "150.129.116.210"
  47.  
  48.  
  49.  
  50. SmtpMail.Send(msg)
  51.  
  52. msg = Nothing
  53.  
  54. lblMsg.Text = "An Email has been Sent"
  55.  
  56.  
  57.  
  58. End Sub
  59.  
  60. </script>
  61.  
  62.  
  63.  
  64.  
  65.  
  66. <form runat=server>
  67.  
  68. <asp:Label id=lblMsg runat=Server /> </form>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement