Control Panel
Forum
Hosting Help
ASP.NET 4 & SQL 2008 R2 Hosting
Resources
Notice
Login
Members
Shared Hosting
|
Upgrade
|
Advertise
|
Tutorials
|
AdSense revenue sharing sites
|
Exam 70-680 Practice Tests
|
Silverlight games
Total
members
:
210365
Average new registrations per day (in last 7 days):
16
New Registration:
Open
Register Now
Home
»
Questions & Answers
»
Mailer
Mailer
3/28/2010
Author:
Florencia DeLeon
Can we implement SMTP mailer. what would be the relayserver host name and port that i should specifly and what else do I need.
Thanks.
Paul
Answers .............
Author:
Ahmed Talu
Posted Date: 3/29/2010
*************************************************
Florencia DeLeon
ASPSPIDER does not let hosted websites use their mailserver. Letting people use a mailserver would lead to abuse by spammers.
When someone needs to send an email in response to someone visiting their website the solution I've seen here in the forum is to use an *.aspx file to connect to some free mail-server like google offers. I do not know if ASPSPIDER still accepts this or not.
*************************************************
Author:
Harshad
Sonata Software Ltd
Posted Date: 4/29/2010
Florencia DeLeon ,
You can use a free mail-server like google(gmail), if u already have a gmail account, you can try this code. This works fine with aspspider.
using System.Net.Mail; // use this in ur mailerform class
SmtpClient mail = new SmtpClient();
mail.Credentials = new System.Net.NetworkCredential(your@gmail.com, your gmailpassword); // mail id and password to be given in double quotes
mail.Host = smtp.gmail.com;
mail.Port = 587;
mail.EnableSsl = true;
MailMessage msg = new MailMessage();
msg.From = new MailAddress(your@gmail.com, ::::Harshad::::, System.Text.Encoding.UTF8); //Mail id to be given in double quotes
msg.IsBodyHtml = true;
msg.Subject = txtSubject .Text;
if(txtBody .Text !=string.Empty)
{
msg.DeliveryNotificationOptions = DeliveryNotificationOptions.OnFailure;
msg.Body = txtBody .Text ;
msg.To.Add(to@gmail.com);//for testing you can give your gmail adress, the To mail id to be given id double quotes
mail.Send(msg);
lblmsg.Text = Delivered succesfully !;
}
else
{lblmsg.Text=Body cannot be blank;}
===========================================================
I tried this and this works fine, even after hosting in aspspider
You must
login
to post answer for this question.
Advertise
Privacy Policy
Terms of use
Contact Us
SpiderWorks Technologies Pvt Ltd.
All Rights Reserved.