Hi every body
i am trying to use mail in my form i have a form name as order form i am taking all the values from the form and i create body of the mail i add from,to,and subject and body to the mail but when i try to send the mail i got some error and i make changes in web.config file also please any one can tell me what are the exact field i have to use in web.config file i will show you what i write in config file
<system.net>
<mailSettings>
<smtp from="">
<network host="" port="3535" userName="" password="" defaultCredentials="true" />
</smtp>
</mailSettings>
</system.net>
please tell me what i have to write in from=
and in host=
i am very much confused with this please help me its very urgent
Loading
Kirtan PatelPosted Aug 5, 2009, 9:31 AM
and For Sending Mail used Following code Successfully Worked With Gmail Server
And Code used to Send mail is Below
Kirtan PatelPosted Aug 8, 2009, 4:56 AM
mohdazeemuddin ahmedPosted Aug 8, 2009, 4:35 AM
Server Error in '/ckom' Application.
Configuration Error
Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately.Parser Error Message: Insufficient permissions for setting the configuration property 'port'.
Source Error:
Kirtan PatelPosted Aug 8, 2009, 4:16 AM
mohdazeemuddin ahmedPosted Aug 8, 2009, 3:59 AM
Kirtan PatelPosted Aug 8, 2009, 3:01 AM
mohdazeemuddin ahmedPosted Aug 8, 2009, 2:53 AM
i tried all possible way but i am not getting email the same code working on localhost on my system i can received mail but when i published and put on the server i am not getting any mail
Posted Aug 7, 2009, 3:15 AM
Not all fields are mandatory in web.config. Please find below code you need to update in web.config and ur application.
Web.config:
<system.net>
<mailSettings>
<smtp>
<network host="host server name" port="25" defaultCredentials="true"/>
smtp>
mailSettings>
system.net>
Application:
SmtpClient smtp = new SmtpClient();
smtp.UseDefaultCredentials = true;
MailMessage mailMessage = new MailMessage();
mailMessage.To.Add( new MailAddress( ToemailAdresss,
ToDisplayname);
//create the mail message
mailMessage.Subject = subject;
mailMessage.Body = messageBody;
mailMessage.From = new MailAddress( fromEmailAddress,
fromDisplayName );
smtp.Send( mailMessage );
for above to work please add
System.Net and System.Net.Mail namespaces.
Please mark this post as anwer if this is helpful.
Happy Coding!!
Wizkid
Kirtan PatelPosted Aug 6, 2009, 4:32 AM
Check Port No if you are using smtp.gmail.com server then Check the port in Web.Config
Port = "587"
and in Username =your gmail whole email Address like "[email protected]"
and in password = your gmail account password
and Be also make Sure that you have enabled POP support in your Gmail account
if you not have enabled POP in gmail account
Do it
1. Login to your gmail account
2. Click on Settings
3. go to Forwarding and POP/IMAP tab
4.Select radio button "Enable POP for all mail"
Thanks
Happy Coding :)
mohdazeemuddin ahmedPosted Aug 6, 2009, 4:17 AM
i make ssl enable but its not working on server
Kirtan PatelPosted Aug 5, 2009, 9:53 AM
as Majority Mail Services like Gmail uses ssl so have to make this option enable .
Happy Coding :)
mohdazeemuddin ahmedPosted Aug 5, 2009, 9:40 AM
is it necessary to enable ssl without ssl we can't do
mohdazeemuddin ahmedPosted Aug 5, 2009, 9:15 AM
I made the setting in web.config as you said i didn't get any error but i didn't received any mail what will be the problem
Kirtan PatelPosted Aug 5, 2009, 8:02 AM
Happy Coding :)
mohdazeemuddin ahmedPosted Aug 5, 2009, 7:50 AM
i type nslookup on the command prompt as you set i got some message that
Cannot find server name for ip address 192.168.56.200:non existent domain
Default server:some name
address: some ip address
i got the above information
Roei BarPosted Aug 5, 2009, 7:42 AM