IIS and SMTP - Re: SmtpMail from aspx.cs Cant send Message – Gives error

This is Interesting: Free IT Magazines  
Home > Archive > IIS and SMTP > October 2004 > Re: SmtpMail from aspx.cs Cant send Message – Gives error





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author Re: SmtpMail from aspx.cs Cant send Message – Gives error
Syed Fahad

2004-10-15, 9:25 pm



Hello

The server rejected one or more recipient addresses. The server response
was: 550 5.7.1

This error occurs when we failed to provide the ip address of the server
that we want to use to send the mail. For e.g, if i have to send mail to
my account fahad@rfmloyalty.com, I must know the Smtp Server that will
relay this email address. In my case, it's local ip is 192.168.0.2 "i m
not providing its real ip or name for some reasons "
so my code in VB.Net to accomplish this is

Private Sub sendMail(ByVal fileName As String, ByVal email As
String)

Dim message As MailMessage = New MailMessage
Dim attachment As MailAttachment = New
MailAttachment(fileName)
message.To = email
message.From = "fahad@rfmloyalty.com"
message.Subject = "An XML File Mailed From Web Page"
message.Priority = MailPriority.High
message.Body = "<B>Salam</B>"
message.Attachments.Add(attachment)
SmtpMail.SmtpServer = "192.168.2"
SmtpMail.Send(message)


End Sub

In your code, you didnt specify the Smtp Server that's y you are getting
error

Please use this

oMM.Attachments.Add(oMA);
Line 36: Smtp.SmtpServer="your server's ip or name"
Line 37: SmtpMail.Send( oMM );
Line 38: }


*** Sent via Developersdex http://www.codecomments.com ***
Don't just participate in USENET...get rewarded for it!
Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com