DaniWeb IT Discussion Community

DaniWeb IT Discussion Community (http://www.daniweb.com/forums/)
-   ASP.NET (http://www.daniweb.com/forums/forum18.html)
-   -   Strange problem in sending emails by asp.net (http://www.daniweb.com/forums/thread27785.html)

serag Jul 9th, 2005 2:35 pm
Strange problem in sending emails by asp.net
 
I use the following code to send email, and strange thing that I received the message at hotmail mail, and failed to receive it at yahoo mail, could you help me and explain what happened and how to overcome this.

Regards
Serag Farag


Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim msgmail As System.Web.Mail.MailMessage
Dim SmtpMail As System.Web.Mail.SmtpMail
msgmail = New System.Web.Mail.MailMessage
' SmtpMail =
msgmail.To = "elomah@yahoo.com"
msgmail.Cc = "ahmed_serageldin@hotmail.com"
msgmail.From = "ahmed_serageldin@hotmail.com"
msgmail.Subject = "subject of ggggggggggggggmsg"
msgmail.BodyFormat = System.Web.Mail.MailFormat.Html
msgmail.Body = " what u send mail ofgh ghgf ghr msgs"

SmtpMail.SmtpServer = "serag-0ivd22eow"
smtpmail.send(msgmail)
Response.Write("msg recived")
End Sub

Letscode Jul 12th, 2005 10:20 am
Re: Strange problem in sending emails by asp.net
 
I used this code before,It worked in both yahoo and hotmail.Thought I would share it with you.But it sends emails to the bulk mail though.

Not sure Y yours did not work.



Imports Microsoft.VisualBasic
Dim Mailmsg As New System.Web.Mail.MailMessage
Dim obj As System.Web.Mail.SmtpMail

Private Overloads Sub Send_Click(ByVal sender As System.Object, ByVal e As System.Web.UI.ImageClickEventArgs) Handles Send.Click
        obj.SmtpServer = "127.0.0.1"
        Mailmsg.To = "blabla@yahoo.com"
        Mailmsg.From = “Bla@yahoo.comâ€?
        Mailmsg.Subject = “blaâ€?
        Mailmsg.Body =â€?blablaâ€?
        obj.Send(Mailmsg)
        lblmailsent.Visible = True
    End Sub





Hope it helps


Quote:

Originally Posted by serag
I use the following code to send email, and strange thing that I received the message at hotmail mail, and failed to receive it at yahoo mail, could you help me and explain what happened and how to overcome this.

Regards
Serag Farag


Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim msgmail As System.Web.Mail.MailMessage
Dim SmtpMail As System.Web.Mail.SmtpMail
msgmail = New System.Web.Mail.MailMessage
' SmtpMail =
msgmail.To = "elomah@yahoo.com"
msgmail.Cc = "ahmed_serageldin@hotmail.com"
msgmail.From = "ahmed_serageldin@hotmail.com"
msgmail.Subject = "subject of ggggggggggggggmsg"
msgmail.BodyFormat = System.Web.Mail.MailFormat.Html
msgmail.Body = " what u send mail ofgh ghgf ghr msgs"

SmtpMail.SmtpServer = "serag-0ivd22eow"
smtpmail.send(msgmail)
Response.Write("msg recived")
End Sub



All times are GMT -4. The time now is 5:41 am.

Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC