Sending Image through Mail

Hi,

          I just created a function to send a mail with the selected image not as an attachement but part of the mail content.

 

"<div>"+

"<img src="+

Server.MapPath(Session["urlofimageinplaceholder"].ToString()) +

" style=width: 501px; height: 418px; />"+

"</div>"

 

This is the HTML tag I created while runtime.

The problem is; the selected image actually, The path of the image available in session in my case has not been attached in the content of the mail. But the mail is sent to the recipient successfully.

 I need your help to solve this problem.

 ThanX in advance.

0
success
5/4/2009 11:55:12 AM
asp.net.futures 1064 articles. 0 followers. Follow

2 Replies
710 Views

Similar Articles

[PageSpeed] 35

You need to use the LinkedResource class to embed images in the email.

Example can be found here.


Regards,

Anas Ghanem.


Note:Please Don't hesitate to click "Report Abuse" link if you noticed something wrong on the forums (like duplicate ,Off-topic,offensive,or any post that violates the website "TERMS OF USE"). -- Thanks!

0
anas
5/4/2009 12:20:37 PM

 Hi..

you can do this by using "LinkedResource".

please see below link for example :

http://www.codeproject.com/KB/aspnet/inkrajesh.aspx

Or

http://www.codedigest.com/Articles/ASPNET/14_Email_with_Embedded_image_in_ASPNet_20.aspx


||- Paresh -||
[GTL-Ahmedabad]
0
paaresh
5/4/2009 12:27:06 PM
Reply:

Similar Artilces:

Why do Sending SMTP Authenticated E-mail succeed using SmtpMail.Send() function but fail using SmtpClient.send() function ? Bugs in System.Net.Mail.SmtpClient when send a Authenticated E-mail?
I click btnOK button, the email can send OK, but click btnFail button,  the following error is displayed! why ? you can test the section code. The SMTP, username, password are valid!  Many thanks! "Syntax error, command unrecognized. The server response was: authentication failed,decode user password error" I have tested some other SMTP, somes is OK. I think there are some bugs with System.Net.Mail.SmtpClient when send a Authenticated E-mail with some SMTP!   //------------------------------------------.ASPX Code----------------------------------------...

.net 2 beta 2 - System.Net.Mail
Hi guysI'm using the System.Net.Mail namespace in .net version 2, beta 2, to send out some HTML formatted e-mails.However, for some reason when the e-mail are sent out some of the full stops from the e-mail are removed.For example, part of the e-mail contains this code<img src="http://www.avonandsomerset.police.uk/images/grey_box_bottom.gif" alt="">But this is what the code is like when the e-mail source code is viewed<img src="http://www.avonandsomerset.police.uk/images/grey_box_bottomgif" alt="">Is this a known bug in beta 2? If so, where can I view a list of known bugs an...

Sending Email through System.Net.Mail is generating errors "Failure Sending mail
hi Sending Email through System.Web.Mail is working fine but System.Net.Mail is generating errors "Failure Sending mail  i treid in all possible ways but did't  pls help in giving a solution thanks & Regards vittal Maybe you can show us some code and post the exact error mesg as well (by looking at the value in ex.tostring)?My HomePage - www.findingsteve.net"It is more blessed to give than to receive." Acts 20: 35 (NIV, Bible)Progress - "Never discourage anyone...who continually makes progress, no matter how slow." Plato System.Web.Ma...

system.net.mail not sending out mail
I recently upgraded from a 2.0 framework to 3.5 using c#.  When I upgraded, I needed to change the way I was using MailMessage.  But now for some reason it doesn't work.  Am I missing something?Below is my code:using System.net.Mail; MailMessage msg = new MailMessage();msg.To.Add(toList);msg.CC.Add(ccList = null ? "" : ccList);msg.From = new MailAddress(fromList);msg.Subject = subject;msg.Body = body;msg.IsBodyHTML = true; SmtpClient smtp = new SmtpClient(smtpServer);smtp.Send(msg); I'm passing all the value from my web.config file inside AppSettings.What ...

About: how can i send a MIME(Text und Html Format) Mail by System.Net.Mail und .Net 2.0
Helle to all, I hope that someone can help me. I need to implement a programm to send newsletters. The newsletter Format can be Html, Text and MIME(Html and Text). when using CDONTS library man can set MailFormat = MIME. But i use System.Net.Mail and there are only text or html Format. Can someone tell me how can i use System.Net.Mail to send a MIME Mail? Thanks Best Regards Pinsha perhaps this link can help:  http://systemnetmail.com/faq/3.1.3.aspxIn this world there are 10 types of people, those that know binary and those who don't....

vb.net, sending mail along with image stored in sql database
Hi All i m able to send a mail with a image saved in image folder my code is :-It is workingDim objMailMessage As New System.Net.Mail.MailMessage With objMailMessage .IsBodyHtml = True.From = New Net.Mail.MailAddress(from) .To.Add(toreceiver) .Subject = "Recommended Product" .Body = email_body() .CC.Add(from)Dim htmlView As AlternateView = AlternateView.CreateAlternateViewFromString(email_body(), Nothing, "text/html") Dim imagelink As New Net.Mail.LinkedResource(Server.MapPath(".") + "\images\baby.gif", "image/gif") 'Dim pa...

Sending mails with Net.Mail: no Email, No Error
hi,i'm using the system.net.Mail namespace to send an email from my application. when i send, the application does not fire any exception, neither does it send the email to my account.below is the code i'm using  Dim mmailMessage As New Net.Mail.MailMessage Dim mFrom As New Net.Mail.MailAddress(mailFrom) mmailMessage.From = mFrom Dim ll As String = "myname@ourmail.com" mmailMessage.To.Add(ll) mmailMessage.Subject = "Talk Concerns" mmailMessage.Body = "Testing Concerns One Two" Dim sm As...

System.Net.Mail.SmtpException: Failure sending mail
Hi, I written the code in .aspx.cs mail send button click event  and i import name space using System.Net.Mail;  String strSubject = "Subject of the mail”;String strMailbody="Body of the mai"; Try{MailMessage Message = new MailMessage();Message.To.Add(new MailAddress("xxxx@domain.com"));Message.From = new MailAddress("xxxx@domain.com"); Message.CC.Add(new MailAddress("xxxx@domain.com"));Message.CC.Add(new MailAddress("xxxx@domain.com")); Message.Subject = strClaimSubject;Message.Body = strClaimMailbody;Messag...

Problem in sending mail using system.net.mail
I am using C# and ASP.Net2.0 for sending mail. But my problem is it is not being sent. I am not being able to understand it. I am using my gmail account for it. I am using System.Net and System .Net.Mail for sending the same. But i am getting the error ''Failure Sending Mail. Cannot connect to the server" . I have internet connection. Plz help me. It's urgent. I am attaching my code.  MailMessage mailMsg = new MailMessage();MailAddress ma = new MailAddress(username@gmail.com); mailMsg.From = ma; mailMsg.To.Add(s);mailMsg.Subject = "Your...

Error handling sending mail (system.net.mail)
 Hi I did an aplication for send membership comunications and i want make a simple upgrade. I have a while for sent the messages to every recipients but i want in each recipient get if the mail has sent or failed, this is for sum that on a cell for the message but i dont know how get if the message go or failed?Im using VB. Somebody can help me on that?  You can't know for sure if the message was delivered or not. The only option would be to read any returned messages from the mail server. Website Design Darlington - http://mdssolutions.co.ukhttp://lesstha...

System.Net.Mail.SmtpException: Failure sending mail
 Hi All,i am sorry if i posted this in wrong forum. but i am stuck have no idea why i keep getting this error . i have mail server with my hosting company. its called mail.mysite.com ( mysite is my domain name. i do have the real domain name even thou i am displaying here). when a customer places a order online, he/she gets an order confirmation email saying that the order has been placed along with their confirmation number. now thats where the error is coming and displays the customer an custom error page to go back and try again. if they do , it finally gives them the order confirmat...

retrieve images from database and send e mail that images
i use the below coding for sending message to mail.using System.Net;using System.Web.Mail;SmtpMail.SmtpServer="mail.mydomain.com"; MailMessage msg=new MailMessage();msg.From = "MyName@MyDomain.com";msg.To=Emailaddress;msg.Subject = "Image";msg.Body="Dear Sir\n"+ "\nYour Image is :"+pass;    SmtpMail.Send(msg);               But Now i want retrieve the images from my database and send that images to e mail.how can i send it.please help me to above task.Thanks.  &nb...

Sending Generic e-mail with System.net.mail
OK. This community is full of very smart and wonderful folks who have helped me out a lot. Here is another head scratcher for me. First off, here is my attached code in question. using System;using System.Data;using System.Configuration;using System.Collections;using System.Web;using System.Web.Security;using System.Web.UI;using System.Web.UI.WebControls;using System.Web.UI.WebControls.WebParts;using System.Web.UI.HtmlControls;using System.Collections.Generic;using System.Text;using System.Net.Mail;namespace dialogcoachdotcom{    public partial class contactus : System.We...

Sending HTML mail using Net.mail and Swedich chars
Hi.  I have tryed all posibble combinations to send HTML mail using the Net:Mail class in .Net 2.0, but what ever I try, all Swedish characters get all messed up. (å, ä, ö) Is there any way to get this to work, or is the best way to just go with text/plain formated mails? /Johan Ch Maby it would be a nice if I was a little bit more specific in my question. Was a bit tired there... The problem is that I have a web-based contact form that I have set up to send text/html mail using Net.Mail. If I look at the mail using Outlook, thay look just fin. But If I send the mail from the form...

need help: sending mail using system.net.mail
hi thr.. i am some help urgently.. i need to send mail using asp.net the cs code is          System.Net.Mail.MailMessage MyMail = new System.Net.Mail.MailMessage();        SmtpClient SmtpMail = new SmtpClient();            try            {                MyMail.From = new MailAddress("balu.naren@gmail.com");  &n...

Web resources about - Sending Image through Mail - asp.net.futures

Sending/receiving relationship - Wikipedia, the free encyclopedia
A sending/receiving relationship is one in which a public school district sends some or all of its students to attend the schools of another ...

U.K. Woman Faces 20 Months For Creating Fake Facebook Accounts, Sending Herself Abusive Messages
A woman in Cornwall in the U.K. came up with a creative way to use Facebook to accelerate a family spat, and it earned her 20 months in prison. ...

CHVRCHES - Dear guys, Please stop sending us emails like... - Facebook
Dear guys, Please stop sending us emails like this. This is one of the more polite ones. Other recent classics include "I'm going to give her ...

Facebook Sending Perez Hilton More Traffic than Google, Driving 3.3% of All US Traffic to Video Sites ...
For media companies evaluating their Facebook marketing strategy , here’s an interesting sign of the times: web analytics firm Hitwise is reporting ...

A better experience for sending Tweets and DMs - Twitter Blog
... panel New Tweet panel in da...... Skip to main content Blog Got an account? Sign in Search form Search &nbsp A better experience for sending ...

How to Go From Working 60 Hours a Week to 40 By Sending 2 Emails a Week
I’m convinced 95% of cubicle workers who work over 60 hours a week constantly can cut it down to 40-45 hours by sending 2 emails a week to their ...

Live Emoji - sending GIF Animation Emoji for Zoosk,Skype,Kik,Whatsapp,Facebook Messenger Etc. on the ...
Get Live Emoji - sending GIF Animation Emoji for Zoosk,Skype,Kik,Whatsapp,Facebook Messenger Etc. on the App Store. See screenshots and ratings, ...


Cynthia McKinney - responds to Obama on sending troops into Afghanistan - Debate Answer - YouTube
Cynthia McKinney, Green Party Presidential candidate, responds to Barack Obama on his support for sending troops into Afghanistan. Based on his ...

Great-grandmother 'would die' before sending kids to Italy
Great-grandmother 'would die' before sending kids to Italy

Resources last updated: 12/29/2015 1:46:15 AM