Re: SmtpMail from aspx.cs Cant send Message – Gives error
Web Server forum
Back To The Forum Home!Search!Private Messaging System

Web Server Talk Web Server Talk > Web Servers reviews > IIS server support > IIS and SMTP > Re: SmtpMail from aspx.cs Cant send Message – Gives error




  Last Thread   Next Thread Next
  Show Printable Version Email this Page Subscribe to this Thread      Post New Thread    Post A Reply      

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


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
10-16-04 02:25 AM



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!





[ Post a follow-up to this message ]



    Sponsored Links  




 





   All times are GMT. The time now is 12:40 PM.      Post New Thread    Post A Reply      
  Last Thread   Next Thread Next


Most Popular forums 

Forum Jump:
Rate This Thread:

Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is OFF
vB code is ON
Smilies are ON
[IMG] code is OFF
 
Medical and Health forum | Computer Games Reviews | Graphics design forum

Back To The Top
Home | Usercp | Faq | Register