2
Answers

emailing

paddylast

paddylast

19y
3.2k
1
Hi, I'm using smtp default server on win xp. I've added relay access of 127.0.0.1. I'm using the following code: using System.Web.Mail; // Create message MailMessage msgMail = new MailMessage(); // Set message properties msgMail.From = txtFrom.Text; msgMail.To = txtTo.Text; msgMail.Subject = txtSubject.Text; msgMail.Body = txtMessage.Text; // Send message SmtpMail.SmtpServer="localhost"; SmtpMail.Send(msgMail); // Clear form fields txtTo.Text = ""; txtSubject.Text = ""; txtMessage.Text = ""; // Show success litStatus.Text = "

Message sent

";
but I get the error The message could not be sent to the SMTP server. The transport error code was 0x800ccc15. The server response was not available Has anyone seen this before? Thanks
Answers (2)
0
brunda k

brunda k

NA 1.5k 11.9k 12y

CREATE TABLE [dbo].[Sample]( [Data] [int] NULL, [Time] [smalldatetime] NULL) ON [PRIMARY]

CREATE TABLE [dbo].[DataGraph]( [Data] [int] NULL, [FromTime] [smalldatetime] NULL, [ToTime] [smalldatetime] NULL) ON [PRIMARY]
Declare @var1 smalldatetime
Declare @var2 smalldatetime
Declare @var3 smalldatetime
SET @var1 = (Select Top(1) [Time] from Sample order by [Time] Asc)
SET @var2 = (Select Top(1) [Time] from Sample order by [Time] desc)
While @var1 < @var2
Begin
Set @var3 = DateAdd(hh, 2, @var1)
IF (@var3 < @var2)
BEGIN
Insert into DataGraph 
select sum(Data) As DT,@var1,@var3 from Sample where CONVERT(varchar, [Time], 108) between CONVERT(varchar, @var1, 108)  AND CONVERT(varchar, @var3, 108)
Set @var1 = @var3
END
ELSE
BEGIN
Insert into DataGraph
select sum(Data) As DT,@var1,@var3 from Sample where CONVERT(varchar, [Time], 108) between CONVERT(varchar, @var1, 108) AND CONVERT(varchar, @var2, 108)
Set @var1 = @var2
END
End