473,504 Members | 13,746 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Send Email

Hi Guys,

I'm using this code to send an email with attachment but it's not working !!
So, what I'm missing!!? knowing that both From & To email addresses are
correct?

MailMessage msgMail = new MailMessage();
msgMail.To = "ba*********@yahoo.com";
msgMail.From = "ba****@bigpond.com";
msgMail.Subject = "Attachment Test";
msgMail.BodyFormat = MailFormat.Text;
msgMail.Body = "Check out the attachment!";
msgMail.Attachments.Add(new MailAttachment("c:\\report.pdf"));
SmtpMail.Send(msgMail);
Response.Write("Email was queued to disk");
Thanks
--
Regards,
M.Rochdi

Aug 13 '07 #1
2 1537
On Aug 13, 3:40 pm, Mike <M...@discussions.microsoft.comwrote:
Hi Guys,

I'm using this code to send an email with attachment but it's not working !!
So, what I'm missing!!? knowing that both From & To email addresses are
correct?

MailMessage msgMail = new MailMessage();
msgMail.To = "badisroc...@yahoo.com";
msgMail.From = "bad...@bigpond.com";
msgMail.Subject = "Attachment Test";
msgMail.BodyFormat = MailFormat.Text;
msgMail.Body = "Check out the attachment!";
msgMail.Attachments.Add(new MailAttachment("c:\\report.pdf"));
SmtpMail.Send(msgMail);
Response.Write("Email was queued to disk");

Thanks
--
Regards,
M.Rochdi
is this working without attachment?

Aug 13 '07 #2
Are your SMTP Server settings correct?

On Aug 13, 9:40 am, Mike <M...@discussions.microsoft.comwrote:
Hi Guys,

I'm using this code to send an email with attachment but it's not working !!
So, what I'm missing!!? knowing that both From & To email addresses are
correct?

MailMessage msgMail = new MailMessage();
msgMail.To = "badisroc...@yahoo.com";
msgMail.From = "bad...@bigpond.com";
msgMail.Subject = "Attachment Test";
msgMail.BodyFormat = MailFormat.Text;
msgMail.Body = "Check out the attachment!";
msgMail.Attachments.Add(new MailAttachment("c:\\report.pdf"));
SmtpMail.Send(msgMail);
Response.Write("Email was queued to disk");

Thanks
--
Regards,
M.Rochdi

Aug 13 '07 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

11
12039
by: Google Mike | last post by:
I've got RH9 Linux with default PHP. Is there a way to send email on Linux to an Exchange Server from PHP and/or other tools when there is *NOT* SMTP access? Has anyone figured out a way to...
40
11781
by: ian | last post by:
Hi, I'm a newbie (oh no I can here you say.... another one...) How can I get Python to send emails using the default windows email client (eg outlook express)? I thought I could just do the...
0
3673
by: David Burson | last post by:
Hi, I have a VB.NET windows app that needs to automatically send a simple text email when my users run a new version of the app for the first time. I thought this would be simple, but after...
9
4292
by: Bob Jones | last post by:
We have developed a commercial ASP.net application (personal nutrition management and tracking); we want to send smtp email from within it. For our development box, we use WinXP Pro, IIS 5.5,...
3
4536
by: Gerard | last post by:
Hello I have created a windows service to monitor a database, it starts some checks when a timer elapses. The checks send emails depending on their findings. My issue is that when I created a...
14
9105
by: supz | last post by:
Hi, I use the standard code given below to send an email from an ASP.NET web form. The code executes fine but no Email is sent. All emails get queued in the Inetpub mail queue. I'm using my...
8
7264
by: shapper | last post by:
Hello, I am trying to send an email using Asp.Net 2.0. I am getting the following error: System.Net.Mail.SmtpFailedRecipientException: Mailbox unavailable. The server response was: No such...
9
77407
by: Mahernoz | last post by:
Can i send an email from JavaScript? Is it possible? If yes please the code to send email using javascript...
2
5620
by: Malli mindwave | last post by:
Hi, We are using the yahoowebHostiing service for my company website, In that one screen of the SendComments/FeedBack section is there, I'm basically dot.net develeoper ,but yahoowebhosting not...
5
2147
by: Mike | last post by:
I have a page with a textbox that a user can enter in mutliple email addresses such as: user1@yahoo.com;user2@yahoo.com;user3@gmail.com; and so on, I then have a foreach loop to get all of the...
0
7213
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,...
0
7366
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
7017
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...
0
5610
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,...
1
5026
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...
0
4698
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...
0
1526
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
754
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
406
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.