Problem Regarding Email Application

7 views
Skip to first unread message

rupali...@gmail.com

unread,
Dec 18, 2006, 2:44:37 AM12/18/06
to Anup Shinde
Hi Anup,
I miss Rupali Rane ve joined ur group since i liked ur articles.
I ve one query i ve developed my email application n everything is
working fine
but problem is i can send only text messages through body part of email
but suppose i want to send image through BODY part i.e.
suppose if i copy some image n paste it in body alongwith the text
message only text
message goes n image does not goes
ie when receipeint checks his emails only text message appears n not
image
y so??????????
can u give me solution?????????????

I ve developed this application in asp.net 2005
so can u pls help me
i am sending my coding part here

Imports System.Net
Imports System.Net.Mail
Imports System.Net.Mime
Imports System.Drawing.Printing

Partial Class Email
Inherits System.Web.UI.Page

Protected Sub Button1_Click(ByVal sender As Object, ByVal e As
System.EventArgs) Handles Button1.Click
'call getdetails to get the To,CC,BCC fields
getdetails()

End Sub
Public Sub getdetails()

'To field cant be empty
If Trim(txtEmail.Text) = "" Then
lblmessage.Visible = True
lblmessage.Text = "The To field Cant be Empty"
Exit Sub
End If
lblmessage.Visible = False

Dim smtpClient As SmtpClient = New SmtpClient
Dim message As MailMessage = New MailMessage
Try
Dim fromAddress = New MailAddress("rr...@hpiinc.com")


SmtpClient.Host = "192.168.1.1"
SmtpClient.Port = 25
SmtpClient.DeliveryMethod = SmtpDeliveryMethod.Network
Dim SMTPUserInfo As New NetworkCredential("rrane", "*****",
"shah")
SmtpClient.UseDefaultCredentials = False
SmtpClient.Credentials = SMTPUserInfo
'smtpClient.Credentials = True

message.From = fromAddress
message.To.Add(txtEmail.Text)
If Not (txtcc.Text = "") Then
message.CC.Add(txtcc.Text)
End If
If Not (txtbcc.Text = "") Then
message.Bcc.Add(txtbcc.Text)
End If
message.Subject = txtsub.Text

If chkFormat.Checked = True Then
message.IsBodyHtml = True 'Send the mail in HTML Format
message.Body = txtMessage.Text

Else
message.IsBodyHtml = False

End If

'message.Body = "hello, <b>how r u?</b>"


smtpClient.Send(message)
lblStatus.Text = "Email successfully sent."
Catch ex As Exception
lblStatus.Text = "Send Email Failed." + ex.Message
End Try
End Sub
Protected Sub Page_Load(ByVal sender As Object, ByVal e As
System.EventArgs) Handles Me.Load

End Sub
End Class

Anup Shinde

unread,
Dec 18, 2006, 11:29:54 AM12/18/06
to anups...@googlegroups.com
Please see the following link....that would solve your problem i suppose
 
 
 
To Copy-> Paste the image ....in think you will need a custom HTML editor....i think you are using a simple textbox....(tat wont support images)......
 
There are free html editors (editor control) available on the net.....
 
NOTE: Copy pasting the images will make the images external to the original content

Please let me knw if this works

Reply all
Reply to author
Forward
0 new messages