What are good/bad practices of creating an email scraper? The last thing I want to do is piss people off. Are there any laws/regulations that my program should conform to?
The second question:
It's easy to fetch a list of emails from a website/document.. But what if I wanted to associate something like a Name, an Address, and a Phone Number? I'm sure I could use RegEx to extract all of that info no problem, but how do I know which email to associate the Name, Address, and Phone number with? Is that even possible?
I'm trying to create this for my marketing team. We get hundreds of PDF documents sent to us per month, all containing lists of client emails and contact information. We also get directed to company staff directory websites a lot, and would like to be able to extract the information from them without having to copy/paste each element in the list, which is how my company is doing it now. We'd much rather be able to click a button and have a program automate these tasks for us.
I am trying to add an attachment to an email in c#. I've managed to send the email with the subject, body and everything just fine. When it comes to adding an attachment it just wont attach and will send me the email without it.
This is the code I've used for adding the attachment
System.Net.Mail.Attachment attachment; attachment = new System.Net.Mail.Attachment(@"C:UsersWilliamPicturesa.TXT"); MyMailMessage.Attachments.Add(attachment);
The only thing i can think of thats wrong with it is the file path even though i tried multiple paths, formats, using \ instead of @ so i just dont know.
If I wanted to learn about how to create an email server from scratch using C++ where would I go online. I am probably in way over my head but I figured I would give it a try anyway and see how things go.
Write an email simulator that processes mail at an average of 40 messages per minute. As messages are received, they are placed in a queue.assume that the messages arrive at an average rate of 30 messages per minute.messages must arrive randomly.
Each minute, you can dequeue up to 40 messages and send them. Assume that 25% of the messages in the queue cannot be sent in any processing cycle.use a random number to determine whether a given message can be sent. If it can't be sent, enqueue it.
Run the simulation for 24 hours, At the end of the simulation, print the statistics that show:
-The total messages processed. -The average arrival rate. -The average number of messages sent per minute. -The average number of messages in queue in a minute. -The number of messages sent on the first attempt, the number sent on the second attempt, and so forth. -The average number of times messages had to be requeued (do not include the messages sent the first time in this average)
Well, actually I've done a part of the coding. But how to continue it. And here is my code :
#include <iostream> using namespace std; #define SIZE 40 class Queue { int queue[SIZE]; int head, tail; public: Queue(); void Enq(int num);
Ii made one string variable and called it email_confirm. I used cin to get the users email but i don't know to check if the email is real.(without being connected to the internet).
For example,in PHP you can use ereg() or eregi() to see if the email is real, I mean you can see how many characters the email_confirm is made off or how many characters is used after the @ or . is used. is there any functions for this?
I have struggled to send email from my MFC applications using severl methods:
1) http via my server - works but limited 2) M$ Outlook automation - works but not easily interchangeable between machines 3) Windows Sockets - available information simply too complicated 4) Purchase an ActiveX control - I hate black box solutions and am too cheap
I have looked at P. J. Naughter's class CPJNSMTPConnection v2.99 An MFC class to encapsulate the SMTP protocol [URL]
This approach requires the implementation of OpenSSL which turns out to be nothing short of a nightmare to install (so I never got it to run). I am looking for an example of an application that utilizes SMTP via Windows sockets api.
I am currently working on a MFC application and need to send (non-document) files created by the program over email. (either with SMTP client on the machine or web mail)
I have searched the web and some forum and cannot find a code that work. They either have errors, or not Unicode compliant, even when converted they still don't work.
Everything code example seems to use MAPI, but like I said non of them worked.
see here
[URL]
A simpler approach would be to modify or override the event handler OnFileSendMail() that is built into MFC document view framework and use the menu id ID_FILE_SENDMAIL.
To get this feature all you have to do is give any menu item the resource id ID_FILE_SENDMAIL and MFC will call the installed mail client for you. The problem is MFC will attach any open document that is in focus when you select the menu item. The file that I wish to send is not associated with the document so I was wondering if there is a way to find the OnFileSendMail() handler and modify it to send my file instead. I am not too keen on how MFC route command handler such as ID_FILE_NEW, ID_FILE_SENDMAIL etc. These methods/functions are hidden from view or I don't know where to find them.
I have outlook 2007 and i am building a plugin, that will edit the footer for all the email attachments,(for example - abc confidential). How can i write an outlook addin, that will on the fly, will check for excelsheets and word documents and edit their footer with "abc confidential"
I have almost a hundred names in a text file that I want to convert to email addresses and save to another file. I seem to have it working, but it doesn't print the full names in the email prefix. The output I'm looking for is Doe_John@livebrandm, but I'm only getting D_J@livebrandm. I'm not sure what I should specifically be reading up on that applies to this directly.
I am writing a program where I need to read a byte of char data and convert it into a text string of binary data that represents the hex value...
i.e. The char byte is 0x42 so I need a string that has 01000010 in it. I've written the following subroutine....
------------- My Subroutine ---------------------------------------------------------------------- void charbytetostring(char input, char *output){ int i, remainder; char BASE=0x2; int DIGITS=8; char digitsArray[3] = "01";
[Code] ....
When I submitted the byte 0x42 to the subroutine, the subroutine returned to the output variable 01000010... Life is good.
The next byte that came in was 0x91. When I submit this to the subroutine I get garbage out.
I am using a debugger and stepped through the subroutine a line at a time. When I feed it 0x42 I get what I expect for all variables at all points in the execution.
When I submit 0x91 When the line remainder = input % BASE; gets executed the remainder variable gets set to 0xFFFF (I expected 1). Also, when the next line gets executed..
input = input / BASE; I get C9 where I expected to get 48.
My question is, are there data limits on what can be used with the mod (%) operator? Or am I doing something more fundamentally incorrect?
I have written the following code to add data to text files which are required to store 3D scan data (I have to calculate the y-coordinate). My code seems to work except that it stops working when I want to create more than ten text files i.e. the directory I am trying to store them in will not hold any more than ten text files. Code is shown below.
#include <iostream> #include <fstream> using namespace std; int main() { int r = 0; int c = 0; int num[17][15] = { 0 }; [Code] ...
// Here is my code for displaying the data from the text file into a 2d array and height next to it, but I am not able to diaplay the height from 60 to 76 next to the row of the 2d array, as shown in the table below. This is my program:
Recently the health authorities have listed a new way to calculate the body mass index (BMI) of an individual. Values of 20 – 24 are classified as normal, 25-29 as overweight, and 30-34 as heavy.
The table below is a portion of a typical BMI table.
Been trying to configure the GridView to display ony 4 rows of data at a time. I thought it wasn't working because I forgot to set AllowPaging to True, but after I did that, I just get the error of
The data source does not support server-side data paging.
Source Error: Line 66: titlesGridView.DataBind(); // displays query results
Here is my Books.aspx.cs code:
// Fig. 29.11: Books.aspx.cs // Code-behind file for the password-protected Books page. using System; using System.Data.Entity; using System.Linq; namespace Bug2Bug.ProtectedContent { public partial class Books : System.Web.UI.Page {
[Code] ....
Am I missing anything or doing something wrong thats not causing it to page & only display 4 titles at a time?
I have a situation where I am accessing an ASP.NET Generic Handler to load data using JQuery. But since data loaded from Javascript is not visible to the search engine crawlers, I decided to load data from C# and then cache it for JQuery. My handler contains a lot of logic that I don't want to apply again on code behind. Here is my Handler code:
public void ProcessRequest(HttpContext context) { JavascriptSerializer jsonSerializer = new JavascriptSerializer(); string jsonString = string.Empty; context.Request.InputStream.Position = 0; using (var inputStream = new System.IO.StreamReader(context.Request.InputStream))
[Code] ....
I can call the function : getUserControlMarkup() from C# but I will have to apply some URL based conditions while calling it. The contentType.typeOfContent is actually based on URL parameters.
If possible to send JSON data to this handler then how to do that. I am trying to access the handler like this:
Since the calculation I performed gives me -71.77 Volts, I need to match this value to the time that this occurs closest to using my program, and output the time that this occurs at.
Here is my program so far: int main() { std::ifstream inFile; inFile.open("AP.txt"); ofstream results_file ("maxvaluewithinput.txt"); float TimeAtdVMax = 0; float VoltsAtdVmax = 0;
[Code]...
If you're curious, this program isn't for homework. It's part of the independent learning on C++ I'm doing for a Master's Thesis; the program will eventually model the APD90 of a ventricular action potential.
I am wanting to be able to add as many different instances of data, while the user has not stated 'n', but then it only ever writes back to the screen the input for the last set of data. Where as I want to display back to the screen all the data that has been entered.
I am very very new to C++. A bit of background. I have been writing in excel vba for large number crunching, and the code is now taking quite a while to run. A friend of mine suggested i start writing in C++, so i read up on it. And downloaded Code:Blocks.
My VBA Code is:
Sub arrayss() Dim NameArray As Variant Dim datarray As Byte Dim DirectionArray As Variant Dim WinArr As Variant
[Code] .....
Ultimately i would like to recode this to C++, but my first and probably silly question is how do i get the data from Excel to use in C++. I was thinking either to put the data in 3 csv files and convert into three Arrays in C++. Or maybe create a library of the data in C++. Ultimately it is speed i am looking for, so before i start recoding i wanted to start with the best way.
The data is like this in excel: (don't know how to create a table)
So the headers would be in one array, the 15's, 30's etc would be in another array and the 1's and 0's and Empty ( i need it to record an empty cell) would be in another array...