System.Net.Mail Work In One Part Of My C#.net Web App, But Not In Another?

Jun 8, 2010

I have a web application that is running on IIS within my company's domain, and is being accessed via intranet. I have this application sending out email based on some user actions. For example, its a scheduling application in part, so if a task is completed, an email is sent out notifying other users of that.

The problem is, the email works flawlessly in some cases, and not at all in others. I have a login.aspx page which sends out report emails when the page is loaded (its loaded once a day via windows task scheduler) - this always seems to work perfectly. I have an update page which is supposed to send email when text is entered and the "Update" button is clicked - this operation will fail most of the time. Both of these tasks use the same static overloaded method I wrote to send email using System.Net.Mail.

I have tried using gmail as my smtp server (instead of our internal one), and get the same results. I investigated whether having the local SMTP Service running makes any difference, and it doesn't seem to. Besides, since C# is server-side code, shouldn't it only matter whats running on the server, and not the client?Below is my code to send email.

public static void sendEmail(String[] recipients, String sender, String subject, String body, String[] attachments)
{
MailMessage message;[code]....

View 1 Replies


Similar Messages:

Configuration :: System.Net.Mail.SmtpClient Credentials Don't Work With Exchange 2010

Aug 29, 2010

I run a Exchange 2010 server and created an account for one of my websites to send e-mails.

The webserver's IP is even listed on the [Organization Configuration] -> [Hub Transport] -> [Global Settings] -> [Transport Settings] -> [Message Delivery] list.

The code sets a set of Network Credentials, but setting incorrect or correct settings, it doesn't matter; if I list external e-mail addresses, I get a "Mailbox unavailable. The server response was: 5.7.1 Unable to relay for <address>" message, 'local' addresses that are cc-ed, do get delivered...

When checking with telnet, I noticed that the only AUTH option was AUTH NTLM, but when checking the NetworkCredentails, it stated that NTLM should would.

View 2 Replies

Web Forms :: Difference Between System.Web.Mail And System.Net.Mail?

May 27, 2010

what is diff between System.Web.Mail and System.Net.Mail.....

View 6 Replies

Using System.Web.Mail And System.Net.Mail - Error "MailMessage Is Ambiguous"

Dec 29, 2010

We have a website which we have re-designed and coded to work using System.Net.Mail but other parts of our website use System.Web.Mail We have specified the namespaces to be used in our web.config file but as we are specifying both System.Net.Mail and System.Web.Mail and they both use MailMessage it throws an error 'MailMessage' is ambiguous, imported from the namespaces or types 'System.Web.Mail, System.Net.Mail'. Is there anyway to avoid this error and still use both namespaces?

View 2 Replies

Sending Mail Message To Multiple Addresses Using System.Net.Mail

Sep 15, 2010

VWD 2008 Express. Visual Basic. I use the following routine (XXXXX have replaced sensitive data) to try to send an email message to mutiple email addresses. It only sends to the first email address in the comma-delimited list. How can I send the message to multiple email addresses?

View 6 Replies

Web Forms :: System.Net.Mail.SmtpException: Failure Sending Mail

Sep 17, 2010

'System.Net.Mail.SmtpException: Failure sending mail. ---> System.IO.IOException: Unable to read data from the transport connection: net_io_connectionclosed. at System.Net.Mail.SmtpReplyReaderFactory.ProcessRead(Byte[] buffer, Int32 offset, Int32 read, Boolean readLine) at............................

getting the above error when sending mail from asp.net 2.0

View 16 Replies

Mail Stopped Sending With System.net.mail?

Jun 16, 2010

I've built several websites on my local machine and have successfully tested sending mail from within the application, but suddenly the mail won't go anywhere! I have a try-catch routine, and I'm getting the message that the mail has been sent successfully but it's not going anywhere. This is the code that I've used in a test page - the html page has a button and a textbox and nothing else. I've imported the system.net.mail namespace.

[Code]....

I'm getting the 'Email Successfully Sent' Message but I'm not receiving the email. I don't think I've changed any settings to stop the emails from going.

View 8 Replies

Adding Attachment To E-mail Using System.Net.Mail?

Dec 8, 2010

I'm trying to add an attachment to an e-mail which I'm sending out, but the attaching part doesn't appear to be working properly since I do not receive the attachment. Anyone know why this is occuring? No exceptions are being thrown. I am sending the

[Code]....

View 2 Replies

MVC :: Using Images From The Servers File System Not Part Of The Application?

Jun 17, 2010

I need to use images in my ASP.NET MVC application that are not included in the application, but are saved in the file system of the server under the c/documents folder.

How can I get these images?

I have a AppHelper class that looks like this and will use to get the path

[Code]....

then in my view i will use this the get that image

[Code]....

View 11 Replies

How To Send Emails By Using System.Net.Mail

Aug 31, 2010

How to send emails by using System.Net.Mail [top]

CODE-BEHIND:

[code]....

i m sending mail by this method but it generate exception"SMTP EXCEPTION NOT HANDELED BY USER"

and in details it shows as:"base {System.Exception} = {"Failure sending mail."}

[System.Net.Mail.SmtpException] = {"Failure sending mail."}
StackTrace = " at System.Net.Mail.SmtpClient.Send(MailMessage message)
at ExptMail.Button1_Click(Object sender, EventArgs e) in f:\dh\websites\ExptMail.aspx.cs:line 32""

View 1 Replies

Web Forms :: System.Net.Mail.MailMessage From?

Mar 15, 2011

I'm having problems with the "From". No matter what i put in, it is always getting filled out with whatever account i'm using to log into the smtp services. Here is the code.. not sure what i'm doing wrong by the examples I've looked at.

[Code]....

I've checked my mFrom property and it has the correct email address i'm trying to send it from.. Is the from just always filled out with the info that the email is sent from

View 5 Replies

Web Forms :: System.Net.Mail Works Only 3 Times

Mar 11, 2010

I have this code up in a live windows 2003 sp2 server. I use Hmailserver as mail server and I am not sure if this cause the problem.I am able to send email consecutively 2 time no problem, but it is always the 3rd time after I would get this error: Unable to read data from the transport connection: net_io_connectionclosed. I wait for 30 minutes I am to send email again, but only the first 2 time works. Here is my code can someone please verify my code and see if anything is wrong with it.

View 3 Replies

C# - Email Formatting Using System.Net.Mail Smtpclient?

Feb 24, 2011

How do I format the body of the email so it doesn't look so old school :) I've tried sending html through it, but it just comes out as html in the body of the email.

View 2 Replies

System.Net.Mail.SmtpException : Mailbox Unavailable

Sep 14, 2010

I've been getting the following exception when trying to send an e-mail using System.Net.Mail:

Unhandled exception in Service Thread:

System.Net.Mail.SmtpException: Mailbox unavailable. The server response was: Requested action not taken: mailbox unavailable
at System.Net.Mail.DataStopCommand.CheckResponse(SmtpStatusCode statusCode, String serverResponse)
at System.Net.Mail.SmtpConnection.OnClose(Object sender, EventArgs args)
at System.Net.ClosableStream.Close()
at System.Net.Mail.MailWriter.Close()
at System.Net.Mail.SmtpClient.Send(MailMessage message)

Does anyone know what this could be caused by?

View 3 Replies

Email Attachment Not Sending With System.web.mail

Nov 5, 2010

I have the following code in a function to send an email out

[Code]....

Calendarstream(pageID) returns the following filepath as a string
c:\inetpub\wwwroot\foldername\emailAttachments\calendar.ics

The value of attachment is the the filepath being returned however the attachment is not sending. The emails sends without the attachment.

View 2 Replies

Web Forms :: Embedding Hyperlink In Email Using System.Net.Mail?

Sep 25, 2010

My goal is to embed a link in the email.

Purpose is that the user needs to click the link in his email to activate the account.

But my emailbody with the link is just shown as plain-Non clickabel text.

the body text looks like:

string mailBody = "please click the following link to activate your account:<br>

[Code]....

[Code]....

smtp.Send(mailMsg);

How do i embed this link in the receivers email as hyperlink instead of plain nonclickable text?

View 2 Replies

Web Forms :: Is Possible To Send All The Content From PH1 By Using Namespace System.Net.Mail

Mar 3, 2011

i´m creating a webpage as a project to school. In this project i´m dynamically adding data to Placeholder (PH1). Is possible to send all the content from PH1 by using namespace System.Net.Mail?

View 2 Replies

Web Forms :: System.Net.Mail.MailMessage With Ddl.selectedvalue As The To Field?

Aug 3, 2010

I have 3 issues that I am attempting to resolve in development with using an aspx page to send email (both internal and external).1. Using the ddl.SelectedValue for the To email address doesn't send the email to the person, but will still cc and bcc the hard-coded recipients. If I replace the(DropListVendor.SelectedValue.Trim()) withmyemail@chuckanddons.com it sends just fine. However I need my users to be able to select which vendor to email, hence the Drop Down list for Vendor. I'll post my code below.

View 3 Replies

Web Forms :: How To Use Html In String Variable In System.net.mail

Dec 18, 2010

I have a task to send mail for updated values my code is below i cant able to set proper format for that

[Code]....

View 6 Replies

Web Forms :: URI Formats Are Not Supported To System.Net.Mail.LinkedResource

Dec 27, 2010

URI formats are not supported.

string fileName ="MailFiles/MailImage/rpLoginLogo.png";

string path = System.Web.HttpContext.Current.Request.Url.AbsoluteUri.Remove(System.Web.HttpContext.Current.Request.Url.AbsoluteUri.LastIndexOf('/') + 1) + fileName;
System.Net.Mail.LinkedResource imageResourceEs = new System.Net.Mail.LinkedResource(path, "image/gif");
not error in direct path of //string path = @"D:ProjectsRPPortalBLRPPortal" + fileName;

View 1 Replies

Web Forms :: Automatically Sending Mail System To Website?

Aug 2, 2010

Currently, I'm trying to do automatically sending mail system to my web-site.

This is how it shall work;

I keep , e-mail - sending time , pair at database , such as

example@hotmail.com , 10.30 PM

example2@yahoo.com , 06.00 AM

What i want is , sending a pdf attachment to these mails everyday when time is 10.30 PM and 06.00 AM . I've a function which creates pdf attachment. I've also a function which sends e-mail.

How can i always check if it's time for sending a mail or not ?

View 2 Replies

Configuration :: 4.3.1 Insufficient System Resources In Sending Mail?

Sep 14, 2010

there is problem of low disc space or FAT partitioning but

I don't what kind of disc space is used in smpt server for the sending mail and what is this

FAT partitining is used in this and how to configure this , all together what is the exact solution of the code error no. 4.3.1 Insufficient system resources for sending mail .

View 2 Replies

Inserting A Table In HTML Email With System.Net.Mail?

Jan 30, 2011

I am having trouble putting all of the pieces together.

Can anyone give me an example of code to use with ASP.Net 3.5 that will send an HTML email using a Table in the Body? Or as the Body?

View 5 Replies

Configuration :: System.Net.Mail Not Working When Triggered From Some Client PC's?

Jun 1, 2010

I am using System.Net.Mail in C#.net website. Basically, I use this to send email alerts to users when some action has occurred.

The problem is, when some PC's are used to trigger an email, nothing happens. I have 2 PC's in my office, and when I do the action on one of them, it works, but not on the other. Why is that?

Also, when an action is triggered by the login page (email reports), it works everywhere, but not on other pages.

I thought C# was server-side code? Shouldn't everything work or not work based on what the server has installed?

View 6 Replies

Security :: Email Encryption Using System.Net.Mail Assembly?

Sep 7, 2010

Has anyone used the above assemblies to send emails using public key enryption, specifically PGP?

View 1 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved