943,829 Members | Top Members by Rank

Ad:
  • ASP.NET Discussion Thread
  • Unsolved
  • Views: 2645
  • ASP.NET RSS
Jan 7th, 2009
0

Email Concept Using Asp.net with VB or C#

Expand Post »
Hi Friends

Wish U Happy New Year 2009

I Need Email sending Concept in asp.net

If possible sent me some notes about email concept and

sample codings....

Waiting for valuable Rply


Thanks with
vishnukumar SR
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
srvishnukumar is offline Offline
15 posts
since Aug 2008
Jan 7th, 2009
0

Re: Email Concept Using Asp.net with VB or C#

asp.net Syntax (Toggle Plain Text)
  1. using System.Net.Mail;
  2.  
  3. MailMessage msg = new MailMessage(strFrom, strTo, strSubject, strBody);
  4. SmtpClient cls = new SmtpClient("ur sys IP or n/w IP");
  5. Attachment atchmntn = new Attachment(abc/xyz....ur attachment);
  6. atchmntn.Name = "abc.jpg";
  7. msg.Attachments.Add(atchmntn);

You can use this code.

If u get any problem chk ur SMTP settings particularly Relay Restrictions settings....

Hope this helps you...

Regards
Anil Reddy
Last edited by peter_budo; Jan 11th, 2009 at 2:44 pm. Reason: Keep It Organized - For easy readability, always wrap programming code within posts in [code] (code blocks) and [icode] (inline code) tags.
Reputation Points: 10
Solved Threads: 0
Newbie Poster
AnilReddy is offline Offline
10 posts
since Jan 2009
Jan 7th, 2009
0

Re: Email Concept Using Asp.net with VB or C#

Click to Expand / Collapse  Quote originally posted by AnilReddy ...
using System.Net.Mail;

MailMessage msg = new MailMessage(strFrom, strTo, strSubject, strBody);
SmtpClient cls = new SmtpClient("ur sys IP or n/w IP");
Attachment atchmntn = new Attachment(abc/xyz....ur attachment);
atchmntn.Name = "abc.jpg";
msg.Attachments.Add(atchmntn);

You can use this code.

If u get any problem chk ur SMTP settings particularly Relay Restrictions settings....

Hope this helps you...

Regards
Anil Reddy






HI Sir,

How Can I Create STMP Server ? Plz Explain me sir

regards,
vishnukumar SR
Reputation Points: 10
Solved Threads: 0
Newbie Poster
srvishnukumar is offline Offline
15 posts
since Aug 2008
Mar 20th, 2009
0

Re: Email Concept Using Asp.net with VB or C#

Hi

1)You can import system.net.mail

2) You can use this code
ASP.NET Syntax (Toggle Plain Text)
  1. Dim mm As New MailMessage(fromid, toid, subject, body)
  2. mm.IsBodyHtml = True
  3. Dim smtp As New SmtpClient
  4. smtp.Send(mm)

3)You can set the mail setting on WEB.CONFIG

xml Syntax (Toggle Plain Text)
  1. <system.net>
  2. <mailSettings>
  3. <smtp>
  4. <network host="localhost" port="23"/>
  5. </smtp>
  6. </mailSettings>
  7. </system.net>


I hope this is useful for you
Last edited by peter_budo; Mar 21st, 2009 at 3:26 pm. Reason: Keep It Organized - For easy readability, always wrap programming code within posts in [code] (code blocks) and [icode] (inline code) tags.
Reputation Points: 10
Solved Threads: 1
Newbie Poster
Ramtamil is offline Offline
3 posts
since Mar 2009
Mar 23rd, 2009
0

Re: Email Concept Using Asp.net with VB or C#

hi,

you can use this code to send mails

ASP.NET Syntax (Toggle Plain Text)
  1. Sub sendmail()
  2. Dim msg As New MailMessage
  3. msg.From = txtEmail.Text
  4. msg.To = "info@yahoo.co.in"
  5. 'msg.To = "name1@yahoo.com"
  6. msg.Bcc = "name2@yahoo.co.in"
  7. msg.Subject = " Demo Info "
  8. msg.BodyFormat = MailFormat.Html
  9. Dim str As String
  10. msg.Body = mail(str)
  11. msg.Priority = MailPriority.High
  12. Try
  13. SmtpMail.SmtpServer = "localhost"
  14. SmtpMail.Send(msg)
  15. Catch ex As HttpException
  16. Catch ex As Exception
  17. Finally
  18. End Try
  19. End Sub
  20.  
Reputation Points: 25
Solved Threads: 29
Posting Whiz
greeny_1984 is offline Offline
372 posts
since Apr 2007

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in ASP.NET Forum Timeline: form execution
Next Thread in ASP.NET Forum Timeline: Access key to <OBJECT>





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC