Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 8 of 8
  1. #1
    Regular Coder Cipher's Avatar
    Join Date
    Dec 2004
    Posts
    123
    Thanks
    0
    Thanked 0 Times in 0 Posts

    How to send Email

    I tried to send email like this:

    Dim EmailFrom As String = "cipher_k@hotmail.com"
    Dim EmailTo As String = "cipher_kero@yahoo.com"
    Dim Subject As String = "Send Email"
    Dim Body As String = "I'm tryin to send email"
    System.Web.Mail.SmtpMail.Send(EmailFrom, EmailTo, Subject, Body)

    But it showed me this error:

    The "SendUsing" configuration value is invalid

    so how can i send email and wt is the SmtpMail?!

  • #2
    New to the CF scene
    Join Date
    Sep 2005
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Follow the link. It might help you.
    http://www.startvbdotnet.com/aspsite.../sendmail.aspx

    Cheers
    Dan
    Last edited by Fou-Lu; 07-27-2011 at 02:11 PM.

  • #3
    Regular Coder Cipher's Avatar
    Join Date
    Dec 2004
    Posts
    123
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Well Ok
    i think i really need help
    Last edited by Cipher; 10-06-2005 at 05:16 PM.

  • #4
    New Coder
    Join Date
    Feb 2005
    Posts
    24
    Thanks
    0
    Thanked 0 Times in 0 Posts
    <% @Page Language="C#" %>
    <% @Import Namespace="System.Web.Mail" %>
    <%
    MailMessage msgMail = new MailMessage();

    msgMail.To = "christophw@sleeper.Dev.AlfaSierraPapa.Com";
    msgMail.Cc = "webmaster@sleeper.Dev.AlfaSierraPapa.Com";
    msgMail.From = "webmaster@aspheute.com";
    msgMail.Subject = "Hi Chris, another mail";

    msgMail.BodyFormat = MailFormat.Html;
    string strBody = "<html><body><b>Hello World</b>" +
    " <font color=\"red\">ASP.NET</font></body></html>";
    msgMail.Body = strBody;

    SmtpMail.Send(msgMail);

    Response.Write("Email was queued to disk");
    %>
    Asp.Net 1.1 - 20 hrs
    CSS 2.0 - 3 hrs
    XHTML 1.1 - 5hrs
    JavaScript - 5hrs
    Cross-Browser Compatibility - Priceless

  • #5
    Regular Coder Cipher's Avatar
    Join Date
    Dec 2004
    Posts
    123
    Thanks
    0
    Thanked 0 Times in 0 Posts
    how can i use the image in the posting page?!

  • #6
    Regular Coder Cipher's Avatar
    Join Date
    Dec 2004
    Posts
    123
    Thanks
    0
    Thanked 0 Times in 0 Posts
    it still dont work.
    Last edited by Cipher; 10-07-2005 at 12:51 AM.

  • #7
    New Coder
    Join Date
    Feb 2005
    Posts
    24
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Sorry,

    I forgot the Smtp server setting

    add this just before the message is sent.

    SmtpMail.SmtpServer = "yourISPsmtpServer";

    eg. My isp is eastlink and the smtp server is smtp.eastlink.ca
    Asp.Net 1.1 - 20 hrs
    CSS 2.0 - 3 hrs
    XHTML 1.1 - 5hrs
    JavaScript - 5hrs
    Cross-Browser Compatibility - Priceless

  • #8
    Senior Coder
    Join Date
    Dec 2002
    Location
    Arlington, Texas USA
    Posts
    1,072
    Thanks
    4
    Thanked 8 Times in 8 Posts
    here is an example using vb.net

    Code:
    <%@ import Namespace="System.Web.Mail" %>
    <script runat="server">
    Sub btnSendEmail_Click(sender As Object, e As EventArgs)
        Dim myMessage As String
        myMessage = "this is a test email message sent using asp.net"
        Dim Mail As New MailMessage
        Mail.To = txtSendTo.text
        Mail.Subject = "test email"
        Mail.Body = myMessage
        Mail.From = "me@myisp.com"
        Mail.BodyFormat = MailFormat.Text
        SmtpMail.SmtpServer ="mail.myisp.com"
        SmtpMail.Send(Mail)
    
    End Sub
    </script>


  •  

    Posting Permissions

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