Sending email problem - Urgent pls

G

Guest

Hi,

I'm using the bellow code to send emails in a Website that I uploaded in one
of my client's server where it has SMTP installed, BUT some users are
receiving email some others aren't !!?So, what could be the problem? knowing
that all users are using the same code and hitting the same server.



MailMessage objMailMsg = new MailMessage(strFrom,
strTo);objMailMsg.BodyEncoding = Encoding.UTF8;
objMailMsg.Subject = strSubject;

objMailMsg.Body = strMsg;

if (Session["PDF_Path"] != null)
{

AttachmentPath = Session["PDF_Path"].ToString();

Attachment at = new Attachment(Server.MapPath(AttachmentPath));
objMailMsg.Attachments.Add(at);

}

objMailMsg.Priority = MailPriority.High;
objMailMsg.IsBodyHtml = true;

SmtpClient objSMTPClient = new SmtpClient(); objSMTPClient.DeliveryMethod =
SmtpDeliveryMethod.PickupDirectoryFromIis;
objSMTPClient.Send(objMailMsg);
 
J

Just Me

1. ) Are any exceptions being generated when the message is being sent.

2.) Is it allways the same users who do not receive the attachment.

3.) Is the email content the same for all users.

4.) If 2.) is true, then what is different about their email addresses and
are those users able to receive SMTP messages from other sources. ?


HTH
 
H

Hans Kesting

Are only the emails with attachments blocked? I had a problem once where
e-mail filtering software (on the client's network) actively blocked (e-mails
with) pdf attachments.
The filtering rules had to be changed to allow them.

Hans Kesting
 
S

Satish Itty

Do you have multiple email addresses in strTo seperated by semi-colons?
I had a similar issue too. I think it has to do with the new
System.Net.Mail namespace in .NET 2.0 instead of the System.Web.Mail in
1.1 Try this way

MailMessage objMailMsg = new MailMessage();
objMailMsg.From = new MailAddress(strFrom);

//put this in a loop and add all the recipients one by one to the collection
objMailMsg.To.Add(strRecipient);
....
....
objMailMsg.Subject = subject;
objMailMsg.Body = body;
....
objMailMsg.Attachments.Add(at);

....

objSMTPClient.Send(objMailMsg);
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,763
Messages
2,569,563
Members
45,039
Latest member
CasimiraVa

Latest Threads

Top