|
-
Mar 3rd, 2006, 06:24 AM
#1
Thread Starter
Fanatic Member
send email from website
hi
i can send an email from my localhost, no problems.
(set up relay to 127.0.0.1 for local host)
when i upload the app to the server machine.
the messages dont seem to come through when i try to send the emails from the website, on remote machine.
is there anything that should be done extra to ensure that this works or does it have to be coded differently.
thanks
Last edited by d2005; Mar 3rd, 2006 at 06:30 AM.
it works 60% of the time, all the time.
-
Mar 3rd, 2006, 07:07 AM
#2
Thread Starter
Fanatic Member
Re: send email from website
ive just noticed that the messages are on the server machine
in the
c\inetpub\mailroot\queue
any idea why the messages are sitting there and not going out to the appropriate email addresses
it works 60% of the time, all the time.
-
Mar 3rd, 2006, 09:40 AM
#3
Re: send email from website
Most likely because the website is blocking it? This is more of a server ocnfiguration issue, so if your server is hosted, you should contact them and ask them about the SMTP details.
-
Mar 3rd, 2006, 08:26 PM
#4
PowerPoster
Re: send email from website
yeh i had this before.
it is to do with the way relay is set up on your machine - you also have to have CDONTS installed on your server in order to send emails i believe.
-
Mar 6th, 2006, 04:14 AM
#5
Thread Starter
Fanatic Member
Re: send email from website
the server in question is just a compter sitting beside me,
ill keep messing about with its configuration and let you know.
just making sure it wasnt my code as the code uses
SmtpMail.SmtpServer = "localhost"
thanks
Last edited by d2005; Mar 6th, 2006 at 04:18 AM.
it works 60% of the time, all the time.
-
Mar 6th, 2006, 07:18 AM
#6
Thread Starter
Fanatic Member
Re: send email from website
i have the relays set up and the cdonts registsered on the machine
still everything sts in the queue folder
what a nightmare
it works 60% of the time, all the time.
-
Mar 6th, 2006, 07:34 AM
#7
PowerPoster
Re: send email from website
just a possibility but could be the ISP denying you setting up relay on the computer - just a thought.
tried using another smtp service?
btw - what OS are you using? or rather what version of IIS?
http://www.microsoft.com/technet/pro...87a2b88f2.mspx
http://www.experts-exchange.com/Web/..._21599320.html
http://www.systemwebmail.com/faq/1.6.aspx
-
Mar 6th, 2006, 07:41 AM
#8
Thread Starter
Fanatic Member
Re: send email from website
Code:
xp pro
IIS 5.1
SMTP Protocol
Microsoft Corporation
Version: Build 6015
im sitting here on this machine developing the app.
if i build and run it here it wokrs fine. i recieve the emails no probs
if i move my app to the machine beside me(xp pro), used as a server for the moment for development purposes all emails sit in that queue folder when i use my app from a remote machine.
both computers seem to have the same settings, though obviously not
im considering burning the machine, would this help?
VB Code:
Dim msg As New MailMessage
msg.Subject = "Query from customer"
msg.BodyFormat = System.Web.Mail.MailFormat.Text
msg.Body = lblcompanyname.Text & ", " & txtComments.Text
msg.Priority = MailPriority.High
SmtpMail.SmtpServer = "127.0.0.1"
Try
SmtpMail.Send(msg)
txtComments.Text = " * Message Sent Sucessfully *"
Catch exc As Exception
txtComments.Text = ("Send failure: " + exc.ToString())
End Try
Last edited by d2005; Mar 6th, 2006 at 07:44 AM.
it works 60% of the time, all the time.
-
Mar 6th, 2006, 08:36 AM
#9
PowerPoster
Re: send email from website
hang on....
you are saying that all this works fine on computerA, which has the SMTP set up?
you are saying that this does NOT work on computerB?
if this is the case, change the SmtpMail.SmtpServer to the computername or IP Address of ComputerA (Which has the SMTP set up successfully)
-
Mar 6th, 2006, 09:07 AM
#10
Frenzied Member
Re: send email from website
Hello D2005,
I was reading your e-mail. I understand that you was having trouble sending e-mail from your web server computer. But you was able to send the e-mail out on your own comptuer. Well I am having trouble sending the e-mail out on my own computer. This is just a little problem l am writing myself on my computer. However, I have check the intepub/mailroot/queue and all the e-mail are just sitting there.
For the IIS I have configured the following. In general tab l have entered the ip address of my computer on port 25. On the access tab - connection i have granted access on 127.0.0.1 and - relay granted access on 127.0.0.1. The code l have is below. I have tried this with winforms and asp.net.
Please could you tell me what I might be doing wrong to send e-mail out on my own computer.
If you read my thrend on this forum, just below yours, you can read the history of what l have done.
Many thanks in advance,
Steve
Code:
using System.Web.Mail;
private void btnSend_Click(object sender, EventArgs e)
{
try
{
//Construct a new mail message and fill it with information from the form
MailMessage aMessage = new MailMessage();
aMessage.From = txtFrom.Text;
aMessage.To = txtTo.Text;
aMessage.Cc = txtCC.Text;
aMessage.Bcc = txtBCC.Text;
aMessage.Subject = txtSubject.Text;
aMessage.Body = txtMessage.Text;
//If an attachment file is indicated, create it and add it to the message
if (txtAttachment.Text.Length > 0)
{
aMessage.Attachments.Add(new MailAttachment(txtAttachment.Text, MailEncoding.Base64));
}
SmtpMail.SmtpServer = "127.0.0.1";
//Now send the message
SmtpMail.Send(aMessage);
//Indicate that the message has been sent
MessageBox.Show("Message sent to " + txtTo.Text, "E-mail Program", MessageBoxButtons.OK, MessageBoxIcon.Information);
}
catch (Exception ex)
{
MessageBox.Show(ex.Message.ToString());
}
-
Mar 6th, 2006, 09:19 AM
#11
Thread Starter
Fanatic Member
Re: send email from website
 Originally Posted by Techno
hang on....
you are saying that all this works fine on computerA, which has the SMTP set up?
you are saying that this does NOT work on computerB?
if this is the case, change the SmtpMail.SmtpServer to the computername or IP Address of ComputerA (Which has the SMTP set up successfully)
the ipaddresses of both machines shall be the same. they are both behind a router. i view my webpages through the use of port 88.
i.e. to view the webpage from server machine
ipaddress:88/webform1.aspx
it successfully worked when i just used local host or 127.0.0.1
not the computer name.
i seem to be a bit lost.
how do i change the smtpmail.smtpserver
it works 60% of the time, all the time.
-
Mar 6th, 2006, 09:24 AM
#12
PowerPoster
Re: send email from website
no no, computers cannot have the same IP Address, the router issues a DHCP IP address to your computers - each computer will have a unique IP Address from DHCP
in your code where it says :
"SmtpMail.SmtpServer = 127.0.0.1"
change it to the name of computerA or the IP Address of ComputerA (the one which has the SMTP server working successfully)
-
Mar 6th, 2006, 09:25 AM
#13
Thread Starter
Fanatic Member
Re: send email from website
 Originally Posted by steve_rm
Please could you tell me what I might be doing wrong to send e-mail out on my own computer.
Steve
steve
try my code given above.
to be honest with you i the only thing i changed was the relay to 127.0.0.1 in my smtp server. this allowed the emails to be sent succsessfully through
SmtpMail.SmtpServer = "127.0.0.1"
or
SmtpMail.SmtpServer = "localhost"
before you try it again
stop your smtp
delete all the files in the queue folder
then restart it because i think i heard somewhere that that may hold it up.
it works 60% of the time, all the time.
-
Mar 6th, 2006, 09:27 AM
#14
Thread Starter
Fanatic Member
Re: send email from website
 Originally Posted by Techno
no no, computers cannot have the same IP Address, the router issues a DHCP IP address to your computers - each computer will have a unique IP Address from DHCP
in your code where it says :
"SmtpMail.SmtpServer = 127.0.0.1"
change it to the name of computerA or the IP Address of ComputerA (the one which has the SMTP server working successfully)
i think the router is issuing us numbers such as
10.0.0.20
and 10.0.0.9
etc.....
are these the ipconfigs you refer too
ill try it now in the mean time
it works 60% of the time, all the time.
-
Mar 6th, 2006, 09:33 AM
#15
Thread Starter
Fanatic Member
Re: send email from website
the ipconfig that works through localhost is 10.0.0.20
it also works if i relay 10.0.0.20 and name it as my smtp server.
ill try it now on the other machine. (with different smtpserver)
it works 60% of the time, all the time.
-
Mar 6th, 2006, 09:47 AM
#16
Thread Starter
Fanatic Member
Re: send email from website
the other machine is 10.0.0.9
and i changed the code and relays it accordngly
guess wot..........
it didnt work lol
i think ill just use pigeons to send mail. 
what is the queue folder anyways
it works 60% of the time, all the time.
-
Mar 6th, 2006, 10:05 AM
#17
PowerPoster
Re: send email from website
the queue folders are where mail waiting to be sent are stored in.
so you set the smtp mail server in the code to 10.0.0.20 and that did not work?
-
Mar 6th, 2006, 10:13 AM
#18
Thread Starter
Fanatic Member
Re: send email from website
10.0.0.20 works for the machine i develop on. no problems there
the ip of the server machine is 10.0.0.9 so i changed my code accordingly
it did not work on my server machine.
it works 60% of the time, all the time.
-
Mar 6th, 2006, 10:21 AM
#19
PowerPoster
Re: send email from website
interesting, it should as the 10.0.0.20 machine works according to you.
im out lol
-
Mar 6th, 2006, 10:23 AM
#20
Thread Starter
Fanatic Member
Re: send email from website
Last edited by d2005; Mar 6th, 2006 at 10:56 AM.
it works 60% of the time, all the time.
-
Mar 6th, 2006, 10:59 AM
#21
Thread Starter
Fanatic Member
Re: send email from website
could the problem be?
im just throwing this out there.
because im using xppro, or has that got anything to do with it?
it works 60% of the time, all the time.
-
Mar 6th, 2006, 10:13 PM
#22
Frenzied Member
Re: send email from website
Hello D20005,
I have found some information on another post that told me that you cannot directly send e-mails from the outside to hotmail, yahoo, etc. In order for you to do this you have to send a username and password to be authenticated for hotmail, yahoo, etc. I thought it was possible to send e-mails to these accounts.
I did what you suggested and my code is similar to yours. I deleted the mails from inetpub/mailroot/queue and restarted IIS. But still did not work.
Did you manage to send an e-mail from your IIS to hotmail. I noticed that you assigned a hotmail address in your code.
Thanks,
Steve
-
Mar 7th, 2006, 04:33 AM
#23
Thread Starter
Fanatic Member
Re: send email from website
yeah mines goes to hotmail no probs from my local host.
it just doesnt seem to run on the other machine.
we have to be doing something wrong
i dont think its the code, i think its the settings
lol
Last edited by d2005; Mar 7th, 2006 at 04:38 AM.
it works 60% of the time, all the time.
-
Mar 7th, 2006, 06:08 AM
#24
Thread Starter
Fanatic Member
-
Apr 16th, 2009, 07:14 AM
#25
New Member
Re: send email from website
Hi,
I had some similar problem couple of years ago and when i installed outlook on the server my problem was solved.
do u have office(outlook) installed on your machine? If yes then check if the server have it too...if the server does not have outlook try to installed id with some default account(virtual) or u can just use the outlook part of the office carnal(shell) or use the outlook dll...
-
Apr 16th, 2009, 07:57 AM
#26
PowerPoster
Re: send email from website
remember you need to configure your server to have SMTP if you are sending emails from your own server, or insert the details of your SMTP provider when sending the emails in the smtpclient class
of course if you use Exchange...then it will do it all for you, the SMTP configuration and what not....
again, totally depends on how you are setting up SMTP on your server
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|