TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Mark Tabor
548
2k
460.4k
Sending an email not from gmail account
Jul 20 2016 9:23 AM
I have purchased a domain with registration , so I have now mail account of my own company , i wrote a function to send an email below is the code for email sending
protected
void
SendEmail(
object
sender,
EventArgs
e)
{
using
(
MailMessage
mm =
new
MailMessage
(txtEmail.Text, txtTo.Text))
{
mm.Subject = txtSubject.Text;
mm.Body = txtBody.Text;
if
(fuAttachment.HasFile)
{
string
FileName =
Path
.GetFileName(fuAttachment.PostedFile.FileName);
mm.Attachments.Add(
new
Attachment
(fuAttachment.PostedFile.InputStream, FileName));
}
mm.IsBodyHtml =
false
;
SmtpClient
smtp =
new
SmtpClient
();
smtp.Host =
"smtp.gmail.com"
;
smtp.EnableSsl =
true
;
NetworkCredential
NetworkCred =
new
NetworkCredential
(txtEmail.Text, txtPassword.Text);
smtp.UseDefaultCredentials =
true
;
smtp.Credentials = NetworkCred;
smtp.Port = 587;
smtp.Send(mm);
ClientScript.RegisterStartupScript(GetType(),
"alert"
,
"alert('Email sent.');"
,
true
);
}
}
Now as my email is
[email protected]
as it is not a gmail account so instead of this line
smtp.Host =
"smtp.gmail.com"
; what should i write
Reply
Answers (
2
)
insert parent records's id in child table record as referenc
how can controller pass data show data grid in mvc 4