Go Back   CodingForums.com > :: Server side development > ASP.NET

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 09-26-2005, 11:14 PM   PM User | #1
Cipher
Regular Coder

 
Cipher's Avatar
 
Join Date: Dec 2004
Posts: 123
Thanks: 0
Thanked 0 Times in 0 Posts
Cipher is an unknown quantity at this point
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?!
Cipher is offline   Reply With Quote
Old 09-27-2005, 05:59 AM   PM User | #2
seek1
New to the CF scene

 
Join Date: Sep 2005
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
seek1 is an unknown quantity at this point
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..
seek1 is offline   Reply With Quote
Old 10-06-2005, 02:01 PM   PM User | #3
Cipher
Regular Coder

 
Cipher's Avatar
 
Join Date: Dec 2004
Posts: 123
Thanks: 0
Thanked 0 Times in 0 Posts
Cipher is an unknown quantity at this point
Well Ok
i think i really need help

Last edited by Cipher; 10-06-2005 at 05:16 PM..
Cipher is offline   Reply With Quote
Old 10-06-2005, 02:48 PM   PM User | #4
jbezweb
New Coder

 
Join Date: Feb 2005
Posts: 24
Thanks: 0
Thanked 0 Times in 0 Posts
jbezweb is an unknown quantity at this point
<% @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
jbezweb is offline   Reply With Quote
Old 10-06-2005, 05:16 PM   PM User | #5
Cipher
Regular Coder

 
Cipher's Avatar
 
Join Date: Dec 2004
Posts: 123
Thanks: 0
Thanked 0 Times in 0 Posts
Cipher is an unknown quantity at this point
how can i use the image in the posting page?!
Cipher is offline   Reply With Quote
Old 10-07-2005, 12:49 AM   PM User | #6
Cipher
Regular Coder

 
Cipher's Avatar
 
Join Date: Dec 2004
Posts: 123
Thanks: 0
Thanked 0 Times in 0 Posts
Cipher is an unknown quantity at this point
it still dont work.

Last edited by Cipher; 10-07-2005 at 12:51 AM..
Cipher is offline   Reply With Quote
Old 10-07-2005, 01:03 PM   PM User | #7
jbezweb
New Coder

 
Join Date: Feb 2005
Posts: 24
Thanks: 0
Thanked 0 Times in 0 Posts
jbezweb is an unknown quantity at this point
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
jbezweb is offline   Reply With Quote
Old 10-14-2005, 07:50 PM   PM User | #8
miranda
Senior Coder

 
Join Date: Dec 2002
Location: Arlington, Texas USA
Posts: 1,062
Thanks: 4
Thanked 8 Times in 8 Posts
miranda is an unknown quantity at this point
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>
miranda is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 03:33 AM.


Advertisement
Log in to turn off these ads.