473,659 Members | 2,662 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

asp.net : c#.net : difficulty in sending emails

47 New Member
when i use the code :
Expand|Select|Wrap|Line Numbers
  1. private void Report(int var)
  2.     {
  3.         var++;
  4.         String ToEmail = "";
  5.         String FromEmail = "";
  6.         String Bdy = "";
  7.         ToEmail = System.Configuration.ConfigurationManager.AppSettings["EmailReportTo"];
  8.         FromEmail = System.Configuration.ConfigurationManager.AppSettings["EmailReportFrom"];
  9.         Bdy = var.ToString();
  10.         try
  11.         {
  12.         SmtpMail.Send(FromEmail, ToEmail,"value",Bdy);
  13.         Response.Write("Your Email has been sent sucessfully");
  14.         }
  15.         catch (Exception exc)
  16.         {
  17.         Response.Write("Send failure: " + exc.ToString());
  18.         }
  19.     }
  20.  
the output shows that the email has been send but no email is received on the ToEmail address

when i use :
Expand|Select|Wrap|Line Numbers
  1.  
  2. private void Report(int var)
  3.     {
  4.         var++;
  5.         String ToEmail = "";
  6.         String FromEmail = "";
  7.         String Bdy = "";
  8.         String ServerName = "";
  9.         ServerName = System.Configuration.ConfigurationManager.AppSettings["SMTPServerName"];
  10.         ToEmail = System.Configuration.ConfigurationManager.AppSettings["EmailReportTo"];
  11.         FromEmail = System.Configuration.ConfigurationManager.AppSettings["EmailReportFrom"];
  12.         Bdy = var.ToString() ;
  13.         System.Net.Mail.MailMessage message = new System.Net.Mail.MailMessage();
  14.         message.To.Add(ToEmail);
  15.         System.Net.Mail.MailAddress address = new System.Net.Mail.MailAddress(FromEmail);
  16.         message.From = address;
  17.         message.Subject = "value"; 
  18.         message.Body = Bdy;
  19.         System.Net.Mail.SmtpClient smtp = new System.Net.Mail.SmtpClient(ServerName);
  20.         smtp.Port = 25;
  21.         try
  22.         {
  23.             smtp.Send(message);
  24.             Response.Write("Your Email has been sent sucessfully");
  25.         }
  26.         catch (Exception exc)
  27.         {
  28.             Response.Write("Send failure: " + exc.ToString());
  29.         }
  30.  
  31.     }
  32.  
  33.  
it shows the exception :
Send failure: System.Net.Mail .SmtpFailedReci pientException: Mailbox unavailable. The server response was: 5.7.1 Unable to relay for vishal@yahoo.co .in at System.Net.Mail .SmtpTransport. SendMail(MailAd dress sender, MailAddressColl ection recipients, String deliveryNotify, SmtpFailedRecip ientException& exception) at System.Net.Mail .SmtpClient.Sen d(MailMessage message) at _Default.Report SpamBot(Int32 var)

somebody please help as to how should i send the emails??
Jan 3 '08 #1
2 1194
nateraaaa
663 Recognized Expert Contributor
It sounds like Yahoo is viewing the email you are sending as SPAM. Yahoo then returns an email telling you that the mailbox in unavailable. Try turning off SPAM control in Yahoo and try sending again.

Nathan
Jan 3 '08 #2
vishalgupta
47 New Member
i ried sending to gmail too but the mails do not reach..

if my code is right then why are the mails not reaching any of the specified email addresses....
Jan 4 '08 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

1
2883
by: dan glenn | last post by:
I'm creating HTML emails from a PHP site and sending them out to an email list (just about 40 people so far are on this list). I've tested and confirmed that these emails work in yahoo.com's webmail. And I know they work on *my* Outlook Express. But I have one person (I know of) who gets the emails as plain text, so she sees the HTML code for the email instead of its proper representation. She has, like myself, OE6, and other html emails...
10
4967
by: Stuart Mueller | last post by:
I have an exchange server, that I sometimes use to perform mail shots to clients on our database, these can be upwards of 1000 at a time. As we don't want different clients to see who we are working with we put these mailshots in the bcc field of the mails. This can sometimes cause a problem as we are getting alot of mails bounced back. I would like to write a script to have these emails sent out individually using the to: field of the...
1
5137
by: Ian Taylor | last post by:
Hi all... Is it possible to send RTF-formatted emails using the .NET SmtpMail implementation? I can only find provision in the BodyFormat property of the message to send plain text or HTML emails. I also have a similar problem in sending HTML/RTF emails via MAPI and would appreciate any help anyone could give me in these areas.
2
9225
by: Mr. x | last post by:
Hello, I am sending emails with Hebrew contents. When receiving emails - I cannot see the Hebrew characters (it is not outlook express configuration, because when receiving emails from friends - I see hebrew, it is just sending by myself using *.aspx scripts). In web.config I have the following : <configuration> <system.web>
3
3610
by: Ant | last post by:
Hi, I'm using the MailMessage & smtpMail classes in System.Web.Mail to send mail, however it's not sending any emails. I'm using it on a Windows 2003 server. The simplest way to use this is smtpMail.Send("from@here.com", to@there.com, "Message subject", "Message Body") I'm sending it to my own email address on a different server using a dummy
5
23797
by: Kun | last post by:
i have the following code: ---------------------------------- import smtplib from email.MIMEText import MIMEText fp = open('confirmation.txt', 'rb') msg = MIMEText(fp.read()) From = 'xxxx@xxxx.xxxx.edu'
5
2437
by: Jai | last post by:
Hi, I am in a problem of sending mass emails(newsletter) to my website members. Actually my problem is this: I want to send newsletter to my website members. But I had given a facility for each member to choose different category of products or all products newsletter.
1
2937
by: robbiesmith79 | last post by:
Just so this is out there on the web, I battled the past 24 hours about this. Background info... I developed a ecommerce website in PHP 4 on a shared linux hosting plan from GoDaddy and had the html formatted emails sending as text/html and were going fine with limited header information. Then we moved the site over to a Dedicated Linux hosting plan. This time, it's PHP 5. Things are bound to not work as expected moving to a new...
2
3749
by: lstanikmas | last post by:
Hi, I'm validating a form with this ASP but receiving some blank email responses; does anyone see anything wrong with it?: function isFormVarExcluded(thisForm, strToCheck) { var strExcludeVars = thisForm.elements.value; var arrExcludeVars = strExcludeVars.split(","); for (var j=0; j<arrExcludeVars.length; j++) { if (arrExcludeVars == strToCheck) return true;
0
8427
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8330
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8850
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8523
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
7355
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6178
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5649
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4334
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
1975
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.