Groups | Blog | Home
all groups > iis smtp nntp > july 2004 >

iis smtp nntp : _Message_–_Gives_error


SibAndela
7/2/2004 10:15:01 PM
I want to send an email from the serverside of an aspx page based on data submitted by the client. I also need to attach a file to send to the recipient of the email.

Testing inWindows XP/ Visual Studio .Net:
Uploading the file and saving it – no problem
Creating and populating the MailMessage - no problem
Attaching the file to Mail Message - No Problem

SmtpMail.Send(oMM) –gives following exception.

Exception Details: System.Runtime.InteropServices.COMException: The "SendUsing" configuration value is invalid.

Source Error:

Line 35: oMM.Attachments.Add(oMA);
Line 36:
Line 37: SmtpMail.Send( oMM ); <-- error line
Line 38: }
Line 39:

Same code in windows app in works.
How do I correct this problem.

Thanks

Sib Andela
Jonathan Maltz [MS-MVP]
7/3/2004 11:08:18 PM
Hi,

Do you have a field similar to:

oMM.Fields.Item("http://schemas.microsoft.com/cdo/configuration/send
using") = 2

What is the value?
--
--Jonathan Maltz [Microsoft MVP - Windows Server, Virtual PC]
http://www.visualwin.com - A Windows Server 2003 visual, step-by-step
tutorial site :-)
http://vpc.visualwin.com - Does <insert OS name> work on VPC 2004? Find out
here
Only reply by newsgroup. I do not do technical support via email. Any
emails I have not authorized are deleted before I see them.


[quoted text, click to view]
submitted by the client. I also need to attach a file to send to the
recipient of the email.
[quoted text, click to view]

SibAndela
7/3/2004 11:20:01 PM
Hi Johan.
Dont have such a field
what does it do for me?
Thanks
-----------------------------------------------------------

[quoted text, click to view]
Jonathan Maltz [MS-MVP]
7/4/2004 3:12:21 PM
sendusing Field
Specifies the method used to send messages.

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cdosys/html/_cdosys_schema_configuration_sendusing.asp


--
--Jonathan Maltz [Microsoft MVP - Windows Server, Virtual PC]
http://www.visualwin.com - A Windows Server 2003 visual, step-by-step
tutorial site :-)
http://vpc.visualwin.com - Does <insert OS name> work on VPC 2004? Find out
here
Only reply by newsgroup. I do not do technical support via email. Any
emails I have not authorized are deleted before I see them.


[quoted text, click to view]

SibAndela
7/4/2004 8:36:01 PM
Thanks Kristofer
Going much better but now I get:

The server rejected one or more recipient addresses. The server response was: 550 5.7.1 Unable to relay for aaa@bbbb.ccc
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Runtime.InteropServices.COMException: The server rejected one or more recipient addresses. The server response was: 550 5.7.1 Unable to relay for aaa@bbbb.ccc

Source Error:


Line 36:
Line 37: SmtpMail.SmtpServer = "localhost";
Line 38: SmtpMail.Send( mm );
Line 39: }

Any suggestions - I suspect something in web.config needs to be set?
Thanks to both of you


[quoted text, click to view]
Kristofer Gafvert
7/4/2004 11:06:15 PM
Hello,

Try to add this above Send():

SmtpMail.SmtpServer = "localhost";

(i assume that you want to send using localhost)

--
Regards,
Kristofer Gafvert - IIS MVP
http://www.ilopia.com - When you need help!


[quoted text, click to view]
submitted by the client. I also need to attach a file to send to the
recipient of the email.
[quoted text, click to view]

Jonathan Maltz [MS-MVP]
7/5/2004 4:35:32 AM
Looks like my response before never made it.

sendusing Field
Specifies the method used to send messages.

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cdosys/html/_cdosys_schema_configuration_sendusing.asp

--
--Jonathan Maltz [Microsoft MVP - Windows Server, Virtual PC]
http://www.visualwin.com - A Windows Server 2003 visual, step-by-step
tutorial site :-)
http://vpc.visualwin.com - Does <insert OS name> work on VPC 2004? Find out
here
Only reply by newsgroup. I do not do technical support via email. Any
emails I have not authorized are deleted before I see them.


[quoted text, click to view]

Kristofer Gafvert
7/5/2004 7:13:59 AM
You must configure SMTP so that you are allowed to relay. You can do that by
either allowing localhost to relay, or by passing a valid set of
credentials.

To allow localhost:

Open IIS Manager
Right click "Default SMTP Virtual Server" and click Properties
Click on the "Access" tab.
Click the Relay button
Add your IP (i think that 127.0.0.1 will work, but i'm not sure. If it does
not, select the IP that is assigned to you)

It should now work.

--
Regards,
Kristofer Gafvert - IIS MVP
http://www.ilopia.com - When you need help!


[quoted text, click to view]
current web request. Please review the stack trace for more information
about the error and where it originated in the code.
[quoted text, click to view]
rejected one or more recipient addresses. The server response was: 550 5.7.1
Unable to relay for aaa@bbbb.ccc
[quoted text, click to view]

penghao98 NO[at]SPAM hotmail.com
7/8/2004 9:58:11 AM
I have set relay to allow except, I am getting any errors, but for
some reason, my email never go out, they all got into queue directory,
so is there anything or what configuration need to be done in order to
be able send out mails.
(Right now I am using localhost)
Thanks

[quoted text, click to view]
Kristofer Gafvert
7/8/2004 7:16:37 PM
Check the EventLog for messages related to this. It could be that your
server cannot find the remote server by some reason. This should be written
in the EventLog.


--
Regards,
Kristofer Gafvert - IIS MVP
http://www.ilopia.com - When you need help!


[quoted text, click to view]

Syed Fahad
10/14/2004 6:20:53 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.developersdex.com ***
AddThis Social Bookmark Button